From af19934f292ddd230f99dae52faf29c83cf8bb37 Mon Sep 17 00:00:00 2001
From: Mackenzie Clark <mackenzie.a.z.c@gmail.com>
Date: Mon, 17 Dec 2018 18:46:48 -0800
Subject: [PATCH] normalize to common name sighandler_t

---
 libc-test/build.rs | 5 +++--
 src/windows/mod.rs | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libc-test/build.rs b/libc-test/build.rs
index 0f86cb6f..ffab4523 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 8caef4ed..e4db343e 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"]
-- 
GitLab