diff --git a/libc-test/build.rs b/libc-test/build.rs index 0f86cb6f90aaf2961a1dd09ffacc065e9b03785a..ffab4523017ee26cdb49c282bd07c5490fd7f93b 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -373,8 +373,9 @@ 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(), - + // windows + "sighandler_t" if windows && !mingw => "_crt_signal_t".to_string(), + "sighandler_t" if windows && mingw => "__p_sig_fn_t".to_string(), // OSX calls this something else "sighandler_t" if bsdlike => "sig_t".to_string(), diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 8caef4ed7cb8ebf0b7797c8d22a20a781ebb0c40..e4db343ec204a262f2697f67d3e1b93d98724613 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -27,7 +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 sighandler_t = usize; pub type c_char = i8; pub type c_long = i32; @@ -298,7 +298,7 @@ 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 signal(signum: c_int, handler: sighandler_t) -> sighandler_t; pub fn raise(signum: c_int) -> c_int; #[link_name = "_chmod"]