[Python-checkins] bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421) (GH-13471)

Victor Stinner webhook-mailer at python.org
Wed May 22 07:04:10 EDT 2019


https://github.com/python/cpython/commit/791e5fcbab9e444b62d13d08707cbbbeb9406297
commit: 791e5fcbab9e444b62d13d08707cbbbeb9406297
branch: 3.7
author: Erik Janssens <erik.janssens at conceptive.be>
committer: Victor Stinner <vstinner at redhat.com>
date: 2019-05-22T13:04:06+02:00
summary:

 bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421) (GH-13471)

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.

(cherry picked from commit 925af1d99b69bf3e229411022ad840c5a0cfdcf8)

files:
A Misc/NEWS.d/next/Windows/2019-05-20-20-26-36.bpo-36965.KsfI-N.rst
M 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
index 000000000000..2a531d2c14d9
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2019-05-20-20-26-36.bpo-36965.KsfI-N.rst
@@ -0,0 +1 @@
+include of STATUS_CONTROL_C_EXIT without depending on MSC compiler
diff --git a/Modules/main.c b/Modules/main.c
index e3683b941754..acc59c6c40a9 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -18,8 +18,8 @@
 #  endif
 #endif
 
-#ifdef _MSC_VER
-#  include <crtdbg.h>
+#ifdef MS_WINDOWS
+#  include <windows.h>  /* STATUS_CONTROL_C_EXIT */
 #endif
 
 #ifdef __FreeBSD__



More information about the Python-checkins mailing list