[pypy-commit] pypy win32-faulthandler: More win32 fixes

amauryfa pypy.commits at gmail.com
Thu Apr 6 10:55:18 EDT 2017


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: win32-faulthandler
Changeset: r90992:9f2239748e39
Date: 2017-04-06 16:54 +0200
http://bitbucket.org/pypy/pypy/changeset/9f2239748e39/

Log:	More win32 fixes

diff --git a/pypy/module/faulthandler/faulthandler.c b/pypy/module/faulthandler/faulthandler.c
--- a/pypy/module/faulthandler/faulthandler.c
+++ b/pypy/module/faulthandler/faulthandler.c
@@ -5,8 +5,10 @@
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
+#ifndef _WIN32
 #include <unistd.h>
 #include <sys/resource.h>
+#endif
 #include <math.h>
 
 #ifdef RPYTHON_LL2CTYPES
@@ -478,7 +480,7 @@
     faulthandler_dump_traceback(fd, fatal_error.all_threads, ucontext);
 
     errno = save_errno;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
     if (signum == SIGSEGV) {
         /* don't explicitly call the previous handler for SIGSEGV in this signal
            handler, because the Windows signal handler would not be called */
@@ -625,7 +627,7 @@
 static void
 faulthandler_suppress_crash_report(void)
 {
-#ifdef MS_WINDOWS
+#ifdef _WIN32
     UINT mode;
 
     /* Configure Windows to not display the Windows Error Reporting dialog */
@@ -633,7 +635,7 @@
     SetErrorMode(mode | SEM_NOGPFAULTERRORBOX);
 #endif
 
-#ifndef MS_WINDOWS
+#ifndef _WIN32
     struct rlimit rl;
 
     /* Disable creation of core dump */
@@ -664,7 +666,7 @@
 void pypy_faulthandler_sigsegv(void)
 {
     faulthandler_suppress_crash_report();
-#if defined(MS_WINDOWS)
+#ifdef _WIN32
     /* For SIGSEGV, faulthandler_fatal_error() restores the previous signal
        handler and then gives back the execution flow to the program (without
        explicitly calling the previous error handler). In a normal case, the
diff --git a/pypy/module/faulthandler/faulthandler.h b/pypy/module/faulthandler/faulthandler.h
--- a/pypy/module/faulthandler/faulthandler.h
+++ b/pypy/module/faulthandler/faulthandler.h
@@ -3,7 +3,7 @@
 
 #include "src/precommondefs.h"
 #ifdef _MSC_VER
-typedef Signed intptr_t;
+#include <crtdef.h>
 #else
 #include <stdint.h>
 #endif


More information about the pypy-commit mailing list