Skip to content

Commit d75fc9c

Browse files
committed
strcase*: add redox support
1 parent b758037 commit d75fc9c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

libc-test/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ fn main() {
2727
let rumprun = target.contains("rumprun");
2828
let solaris = target.contains("solaris");
2929
let cloudabi = target.contains("cloudabi");
30+
let redox = target.contains("redox");
3031
let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly;
3132
let mut cfg = ctest::TestGenerator::new();
3233

@@ -354,7 +355,7 @@ fn main() {
354355
}
355356
}
356357

357-
if cloudabi {
358+
if cloudabi || redox {
358359
cfg.header("strings.h");
359360
}
360361

src/redox/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ extern {
231231
pub fn strdup(cs: *const c_char) -> *mut c_char;
232232
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
233233
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
234+
pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
235+
pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
236+
pub fn strncasecmp(s1: *const c_char, s2: *const c_char,
237+
n: size_t) -> c_int;
234238
pub fn strlen(cs: *const c_char) -> size_t;
235239
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
236240
pub fn strerror(n: c_int) -> *mut c_char;

0 commit comments

Comments
 (0)