summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Parker-Shemilt <palfrey@tevp.net>2018-11-23 21:25:23 +0000
committerTom Parker-Shemilt <palfrey@tevp.net>2018-11-23 21:26:02 +0000
commitd75fc9c34acbde46f2665fcc740896b900138094 (patch)
treec2d2c9f1acd7eb78747ac0b0a4baa5995da0a67f
parentb75803751f102b1d672fddeac3391ef7a65ad68c (diff)
downloadrust-libc-d75fc9c34acbde46f2665fcc740896b900138094.tar.gz
strcase*: add redox support
-rw-r--r--libc-test/build.rs3
-rw-r--r--src/redox/mod.rs4
2 files changed, 6 insertions, 1 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 16334d94e5..9afb6240e0 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -27,6 +27,7 @@ fn main() {
let rumprun = target.contains("rumprun");
let solaris = target.contains("solaris");
let cloudabi = target.contains("cloudabi");
+ let redox = target.contains("redox");
let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly;
let mut cfg = ctest::TestGenerator::new();
@@ -354,7 +355,7 @@ fn main() {
}
}
- if cloudabi {
+ if cloudabi || redox {
cfg.header("strings.h");
}
diff --git a/src/redox/mod.rs b/src/redox/mod.rs
index 9870fa6dca..9f68632a0f 100644
--- a/src/redox/mod.rs
+++ b/src/redox/mod.rs
@@ -231,6 +231,10 @@ 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 strcasestr(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;