Skip to content
Snippets Groups Projects
Commit 08eaa2c4 authored by Tom Parker-Shemilt's avatar Tom Parker-Shemilt
Browse files

Split out strcase* into unix, MSVC and Windows-GNU

parent d931cd27
No related branches found
No related tags found
No related merge requests found
......@@ -475,6 +475,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;
#[cfg_attr(
......
......@@ -379,6 +379,22 @@ extern {
#[link_name = "_wsetlocale"]
pub fn wsetlocale(category: ::c_int,
locale: *const wchar_t) -> *mut wchar_t;
cfg_if! {
if #[cfg(all(target_env = "gnu"))] {
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;
} else if #[cfg(all(target_env = "msvc"))] {
#[link_name = "_stricmp"]
pub fn stricmp(s1: *const c_char, s2: *const c_char) -> c_int;
#[link_name = "_strnicmp"]
pub fn strnicmp(s1: *const c_char, s2: *const c_char,
n: size_t) -> c_int;
} else {
// Unknown target_env
}
}
}
cfg_if! {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment