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

Split out windows strcase* work into gnu/msvc files

parent d75fc9c3
No related branches found
No related tags found
No related merge requests found
pub const L_tmpnam: ::c_uint = 14;
pub const TMP_MAX: ::c_uint = 0x7fff;
extern {
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;
}
......@@ -111,18 +111,6 @@ pub const BUFSIZ: ::c_uint = 512;
pub const FOPEN_MAX: ::c_uint = 20;
pub const FILENAME_MAX: ::c_uint = 260;
cfg_if! {
if #[cfg(all(target_env = "gnu"))] {
pub const L_tmpnam: ::c_uint = 14;
pub const TMP_MAX: ::c_uint = 0x7fff;
} else if #[cfg(all(target_env = "msvc"))] {
pub const L_tmpnam: ::c_uint = 260;
pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
} else {
// Unknown target_env
}
}
pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
pub const O_RDWR: ::c_int = 2;
......@@ -381,24 +369,6 @@ extern {
locale: *const wchar_t) -> *mut wchar_t;
}
cfg_if! {
extern {
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! {
if #[cfg(core_cvoid)] {
pub use core::ffi::c_void;
......@@ -416,3 +386,15 @@ cfg_if! {
}
}
}
cfg_if! {
if #[cfg(all(target_env = "gnu"))] {
mod gnu;
pub use self::gnu::*;
} else if #[cfg(all(target_env = "msvc"))] {
mod msvc;
pub use self::msvc::*;
} else {
// Unknown target_env
}
}
\ No newline at end of file
pub const L_tmpnam: ::c_uint = 260;
pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
extern {
#[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;
}
\ No newline at end of file
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