diff options
author | Mackenzie Clark <mackenzie.a.z.c@gmail.com> | 2018-12-17 17:45:06 -0800 |
---|---|---|
committer | Mackenzie Clark <mackenzie.a.z.c@gmail.com> | 2018-12-17 17:57:37 -0800 |
commit | 4c32b9f4b9c15ece4b22418d24d689a3efdb1d94 (patch) | |
tree | 253a76eb74ef86d2e209b821b8b6fcecb058c5e8 /src/windows | |
parent | 2f25aaa235f4e3ffd7eaf1e282f6b35634d33c2e (diff) | |
download | rust-libc-4c32b9f4b9c15ece4b22418d24d689a3efdb1d94.tar.gz |
move everything back into window mod with the type alias for msvc
Diffstat (limited to 'src/windows')
-rw-r--r-- | src/windows/gnu.rs | 12 | ||||
-rw-r--r-- | src/windows/mod.rs | 14 | ||||
-rw-r--r-- | src/windows/msvc.rs | 11 |
3 files changed, 14 insertions, 23 deletions
diff --git a/src/windows/gnu.rs b/src/windows/gnu.rs index cb38f543ca..3568f6226e 100644 --- a/src/windows/gnu.rs +++ b/src/windows/gnu.rs @@ -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; diff --git a/src/windows/mod.rs b/src/windows/mod.rs index f46eb362d8..8caef4ed7c 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -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"] diff --git a/src/windows/msvc.rs b/src/windows/msvc.rs index 47ceafea3a..1ebfcadd16 100644 --- a/src/windows/msvc.rs +++ b/src/windows/msvc.rs @@ -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"] |