bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421)
authorErik Janssens <erik.janssens@conceptive.be>
Tue, 21 May 2019 10:11:11 +0000 (12:11 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 21 May 2019 10:11:11 +0000 (12:11 +0200)
Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant.
Moreover, include windows.h on Windows, not only when MSC is used.

Misc/NEWS.d/next/Windows/2019-05-20-20-26-36.bpo-36965.KsfI-N.rst [new file with mode: 0644]
Modules/main.c

diff --git a/Misc/NEWS.d/next/Windows/2019-05-20-20-26-36.bpo-36965.KsfI-N.rst b/Misc/NEWS.d/next/Windows/2019-05-20-20-26-36.bpo-36965.KsfI-N.rst
new file mode 100644 (file)
index 0000000..2a531d2
--- /dev/null
@@ -0,0 +1 @@
+include of STATUS_CONTROL_C_EXIT without depending on MSC compiler
index 6d4b351e5e177d9ee41050fc88f19ee511efd82c..08fb0e0417d03823e10ac3bf8e1968d8f3dc70ff 100644 (file)
@@ -18,8 +18,8 @@
 #if defined(HAVE_GETPID) && defined(HAVE_UNISTD_H)
 #  include <unistd.h>   /* getpid() */
 #endif
-#ifdef _MSC_VER
-#  include <crtdbg.h>   /* STATUS_CONTROL_C_EXIT */
+#ifdef MS_WINDOWS
+#  include <windows.h>  /* STATUS_CONTROL_C_EXIT */
 #endif
 /* End of includes for exit_sigint() */