diff options
author | Tom Parker-Shemilt <palfrey@tevp.net> | 2018-11-23 21:21:24 +0000 |
---|---|---|
committer | Tom Parker-Shemilt <palfrey@tevp.net> | 2018-11-23 21:26:02 +0000 |
commit | b75803751f102b1d672fddeac3391ef7a65ad68c (patch) | |
tree | b97a7f98f3fbbee7f3b6c166bab13f3c22714ea5 | |
parent | 46f08b52a9dbb164461b39118a44aa6453b030f8 (diff) | |
download | rust-libc-b75803751f102b1d672fddeac3391ef7a65ad68c.tar.gz |
strcase*: Add cloudabi support
-rw-r--r-- | libc-test/build.rs | 5 | ||||
-rw-r--r-- | src/cloudabi/mod.rs | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index e016d38216..16334d94e5 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -26,6 +26,7 @@ fn main() { let openbsd = target.contains("openbsd"); let rumprun = target.contains("rumprun"); let solaris = target.contains("solaris"); + let cloudabi = target.contains("cloudabi"); let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly; let mut cfg = ctest::TestGenerator::new(); @@ -353,6 +354,10 @@ fn main() { } } + if cloudabi { + cfg.header("strings.h"); + } + cfg.type_name(move |ty, is_struct, is_union| { match ty { // Just pass all these through, no need for a "struct" prefix diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs index f72eeb4d24..02b7974ff4 100644 --- a/src/cloudabi/mod.rs +++ b/src/cloudabi/mod.rs @@ -185,6 +185,8 @@ extern { pub fn atexit(cb: extern fn()) -> c_int; pub fn system(s: *const c_char) -> c_int; pub fn getenv(s: *const c_char) -> *mut c_char; + pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, + stream: *mut FILE) -> ssize_t; pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; pub fn strncpy(dst: *mut c_char, src: *const c_char, @@ -201,6 +203,9 @@ extern { pub fn strdup(cs: *const c_char) -> *mut c_char; pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; + pub fn strncasecmp(s1: *const c_char, s2: *const c_char, + n: size_t) -> c_int; pub fn strlen(cs: *const c_char) -> size_t; pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; pub fn strerror(n: c_int) -> *mut c_char; |