From b75803751f102b1d672fddeac3391ef7a65ad68c Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 23 Nov 2018 21:21:24 +0000 Subject: strcase*: Add cloudabi support --- libc-test/build.rs | 5 +++++ src/cloudabi/mod.rs | 5 +++++ 2 files changed, 10 insertions(+) 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; -- cgit v1.2.1