Skip to content

Commit 4d9b179

Browse files
committed
match ndk r14b unified headers
1 parent a38631f commit 4d9b179

File tree

6 files changed

+42
-23
lines changed

6 files changed

+42
-23
lines changed

ci/android-install-ndk.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
set -ex
1313

14-
curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
15-
unzip -q android-ndk-r13b-linux-x86_64.zip
14+
curl -O https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip
15+
unzip -q android-ndk-r14b-linux-x86_64.zip
1616

1717
case "$1" in
1818
aarch64)
@@ -28,9 +28,10 @@ case "$1" in
2828
;;
2929
esac;
3030

31-
android-ndk-r13b/build/tools/make_standalone_toolchain.py \
31+
android-ndk-r14b/build/tools/make_standalone_toolchain.py \
32+
--unified-headers \
3233
--install-dir /android/ndk-$1 \
3334
--arch $arch \
3435
--api 24
3536

36-
rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
37+
rm -rf ./android-ndk-r14b-linux-x86_64.zip ./android-ndk-r14b

ci/run-docker.sh

100644100755
File mode changed.

src/unix/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,12 @@ extern {
670670
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
671671
oldset: *mut sigset_t) -> ::c_int;
672672
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
673+
674+
#[cfg(target_os = "android")]
675+
#[link_name = "__gnu_strerror_r"]
676+
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char,
677+
buflen: ::size_t) -> *mut ::c_char;
678+
#[cfg(not(target_os = "android"))]
673679
#[cfg_attr(all(target_os = "linux", not(target_env = "musl")),
674680
link_name = "__xpg_strerror_r")]
675681
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char,

src/unix/notbsd/android/b32/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ s! {
3535
pub st_size: ::c_longlong,
3636
pub st_blksize: ::blksize_t,
3737
pub st_blocks: ::c_ulonglong,
38-
pub st_atime: ::c_ulong,
39-
pub st_atime_nsec: ::c_ulong,
40-
pub st_mtime: ::c_ulong,
41-
pub st_mtime_nsec: ::c_ulong,
42-
pub st_ctime: ::c_ulong,
43-
pub st_ctime_nsec: ::c_ulong,
38+
pub st_atime: ::time_t,
39+
pub st_atimensec: ::c_long,
40+
pub st_mtime: ::time_t,
41+
pub st_mtimensec: ::c_long,
42+
pub st_ctime: ::time_t,
43+
pub st_ctimensec: ::c_long,
4444
pub st_ino: ::c_ulonglong,
4545
}
4646

@@ -57,12 +57,12 @@ s! {
5757
pub st_size: ::c_longlong,
5858
pub st_blksize: ::blksize_t,
5959
pub st_blocks: ::c_ulonglong,
60-
pub st_atime: ::c_ulong,
61-
pub st_atime_nsec: ::c_ulong,
62-
pub st_mtime: ::c_ulong,
63-
pub st_mtime_nsec: ::c_ulong,
64-
pub st_ctime: ::c_ulong,
65-
pub st_ctime_nsec: ::c_ulong,
60+
pub st_atime: ::time_t,
61+
pub st_atimensec: ::c_long,
62+
pub st_mtime: ::time_t,
63+
pub st_mtimensec: ::c_long,
64+
pub st_ctime: ::time_t,
65+
pub st_ctimensec: ::c_long,
6666
pub st_ino: ::c_ulonglong,
6767
}
6868

src/unix/notbsd/android/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ pub const SOL_NETROM: ::c_int = 259;
428428
pub const SOL_ROSE: ::c_int = 260;
429429

430430
#[doc(hidden)]
431-
pub const AF_MAX: ::c_int = 39;
431+
pub const AF_MAX: ::c_int = 43;
432432
#[doc(hidden)]
433433
pub const PF_MAX: ::c_int = AF_MAX;
434434

@@ -773,15 +773,15 @@ extern {
773773
}
774774

775775
extern {
776-
pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int)
776+
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
777777
-> ::c_int;
778778
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
779-
pub fn msync(addr: *const ::c_void, len: ::size_t,
779+
pub fn msync(addr: *mut ::c_void, len: ::size_t,
780780
flags: ::c_int) -> ::c_int;
781-
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
781+
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
782782
-> ::c_int;
783783
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
784-
flags: ::c_int, addr: *const ::sockaddr,
784+
flags: ::c_int, addr: *mut ::sockaddr,
785785
addrlen: *mut ::socklen_t) -> ::ssize_t;
786786
pub fn getnameinfo(sa: *const ::sockaddr,
787787
salen: ::socklen_t,
@@ -791,8 +791,8 @@ extern {
791791
sevlen: ::size_t,
792792
flags: ::c_int) -> ::c_int;
793793
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
794-
pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
795-
pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
794+
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
795+
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
796796
pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t;
797797
pub fn __sched_cpufree(set: *mut ::cpu_set_t);
798798
pub fn __sched_cpucount(setsize: ::size_t, set: *mut cpu_set_t) -> ::c_int;

src/unix/notbsd/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,9 @@ extern {
10001000
suid: *mut ::uid_t) -> ::c_int;
10011001
pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t,
10021002
sgid: *mut ::gid_t) -> ::c_int;
1003+
#[cfg(target_os="android")]
1004+
pub fn personality(persona: ::c_uint) -> ::c_int;
1005+
#[cfg(not(target_os="android"))]
10031006
pub fn personality(persona: ::c_ulong) -> ::c_int;
10041007
pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
10051008
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
@@ -1009,6 +1012,15 @@ extern {
10091012
pub fn vfork() -> ::pid_t;
10101013
pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int,
10111014
rusage: *mut ::rusage) -> ::pid_t;
1015+
pub fn openpty(amaster: *mut ::c_int,
1016+
aslave: *mut ::c_int,
1017+
name: *mut ::c_char,
1018+
termp: *const termios,
1019+
winp: *const ::winsize) -> ::c_int;
1020+
pub fn forkpty(amaster: *mut ::c_int,
1021+
name: *mut ::c_char,
1022+
termp: *const termios,
1023+
winp: *const ::winsize) -> ::pid_t;
10121024
}
10131025

10141026
cfg_if! {

0 commit comments

Comments
 (0)