Skip to content

Commit

Permalink
Auto merge of #261 - myfreeweb:master, r=alexcrichton
Browse files Browse the repository at this point in the history
64-bit Android timegm fix

On aarch64 and x86_64, `timegm64` does not exist (see [time64.h](https://android.googlesource.com/platform/development/+/797351fd3bbb8fe517afafdd5095fd740387e7a4/ndk/platforms/android-L/include/time64.h)).

See time-rs/time#118 for usage. Since that patch, the time library switched to using libc for `timegm` (time-rs/time@51c0019), and it doesn't build on 64-bit Android. This PR fixes that.
  • Loading branch information
bors committed Apr 12, 2016
2 parents e4447f4 + 6b0e09c commit ba084f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/unix/notbsd/android/b32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ s! {
}

pub const SYS_gettid: ::c_long = 224;

extern {
pub fn timegm64(tm: *const ::tm) -> ::time64_t;
}
4 changes: 4 additions & 0 deletions src/unix/notbsd/android/b64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ s! {
}

pub const SYS_gettid: ::c_long = 178;

extern {
pub fn timegm(tm: *const ::tm) -> ::time64_t;
}
1 change: 0 additions & 1 deletion src/unix/notbsd/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ extern {
serv: *mut ::c_char,
sevlen: ::size_t,
flags: ::c_int) -> ::c_int;
pub fn timegm64(tm: *const ::tm) -> time64_t;
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
Expand Down

0 comments on commit ba084f4

Please sign in to comment.