move everything back into window mod with the type alias for msvc

This commit is contained in:
Mackenzie Clark 2018-12-17 17:45:06 -08:00
parent 2f25aaa235
commit 4c32b9f4b9
4 changed files with 15 additions and 23 deletions

View file

@ -373,6 +373,7 @@ fn main() {
// Fixup a few types on windows that don't actually exist.
"time64_t" if windows => "__time64_t".to_string(),
"ssize_t" if windows => "SSIZE_T".to_string(),
"_crt_signal_t" if windows => "__p_sig_fn_t".to_string(),
// OSX calls this something else
"sighandler_t" if bsdlike => "sig_t".to_string(),

View file

@ -1,19 +1,7 @@
pub type __p_sig_fn_t = ::size_t;
pub const L_tmpnam: ::c_uint = 14;
pub const TMP_MAX: ::c_uint = 0x7fff;
pub const SIGINT: ::c_int = 2;
pub const SIGILL: ::c_int = 4;
pub const SIGFPE: ::c_int = 8;
pub const SIGSEGV: ::c_int = 11;
pub const SIGTERM: ::c_int = 15;
pub const SIGABRT: ::c_int = 22;
pub const NSIG: ::c_int = 23;
pub const SIG_ERR: ::c_int = -1;
extern {
pub fn signal(signum: ::c_int, handler: __p_sig_fn_t) -> __p_sig_fn_t;
pub fn raise(signum: ::c_int) -> ::c_int;
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;

View file

@ -27,6 +27,7 @@ pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type __p_sig_fn_t = usize;
pub type c_char = i8;
pub type c_long = i32;
@ -177,6 +178,16 @@ pub const ENOTEMPTY: ::c_int = 41;
pub const EILSEQ: ::c_int = 42;
pub const STRUNCATE: ::c_int = 80;
// signal codes
pub const SIGINT: ::c_int = 2;
pub const SIGILL: ::c_int = 4;
pub const SIGFPE: ::c_int = 8;
pub const SIGSEGV: ::c_int = 11;
pub const SIGTERM: ::c_int = 15;
pub const SIGABRT: ::c_int = 22;
pub const NSIG: ::c_int = 23;
pub const SIG_ERR: ::c_int = -1;
// inline comment below appeases style checker
#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if "
#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))]
@ -287,6 +298,9 @@ extern {
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);
pub fn signal(signum: c_int, handler: __p_sig_fn_t) -> __p_sig_fn_t;
pub fn raise(signum: c_int) -> c_int;
#[link_name = "_chmod"]
pub fn chmod(path: *const c_char, mode: ::c_int) -> ::c_int;
#[link_name = "_wchmod"]

View file

@ -1,18 +1,7 @@
pub type _crt_signal_t = ::size_t;
pub const L_tmpnam: ::c_uint = 260;
pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
pub const SIGINT: ::c_int = 2;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 22;
pub const SIGFPE: ::c_int = 8;
pub const SIGSEGV: ::c_int = 11;
pub const SIGTERM: ::c_int = 15;
pub const SIG_ERR: ::c_int = -1;
extern {
pub fn signal(signum: ::c_int, handler: _crt_signal_t) -> _crt_signal_t;
pub fn raise(signum: ::c_int) -> ::c_int;
#[link_name = "_stricmp"]
pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
#[link_name = "_strnicmp"]