Skip to content

Commit b758037

Browse files
committed
strcase*: Add cloudabi support
1 parent 46f08b5 commit b758037

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libc-test/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn main() {
2626
let openbsd = target.contains("openbsd");
2727
let rumprun = target.contains("rumprun");
2828
let solaris = target.contains("solaris");
29+
let cloudabi = target.contains("cloudabi");
2930
let bsdlike = freebsd || apple || netbsd || openbsd || dragonfly;
3031
let mut cfg = ctest::TestGenerator::new();
3132

@@ -353,6 +354,10 @@ fn main() {
353354
}
354355
}
355356

357+
if cloudabi {
358+
cfg.header("strings.h");
359+
}
360+
356361
cfg.type_name(move |ty, is_struct, is_union| {
357362
match ty {
358363
// Just pass all these through, no need for a "struct" prefix

src/cloudabi/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ extern {
185185
pub fn atexit(cb: extern fn()) -> c_int;
186186
pub fn system(s: *const c_char) -> c_int;
187187
pub fn getenv(s: *const c_char) -> *mut c_char;
188+
pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t,
189+
stream: *mut FILE) -> ssize_t;
188190

189191
pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
190192
pub fn strncpy(dst: *mut c_char, src: *const c_char,
@@ -201,6 +203,9 @@ extern {
201203
pub fn strdup(cs: *const c_char) -> *mut c_char;
202204
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
203205
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
206+
pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
207+
pub fn strncasecmp(s1: *const c_char, s2: *const c_char,
208+
n: size_t) -> c_int;
204209
pub fn strlen(cs: *const c_char) -> size_t;
205210
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
206211
pub fn strerror(n: c_int) -> *mut c_char;

0 commit comments

Comments
 (0)