]> granicus.if.org Git - python/commitdiff
bpo-30860: Move windows.h include out of internal/*.h. (#3458)
authorEric Snow <ericsnowcurrently@gmail.com>
Tue, 12 Sep 2017 01:30:43 +0000 (18:30 -0700)
committerGitHub <noreply@github.com>
Tue, 12 Sep 2017 01:30:43 +0000 (18:30 -0700)
PR #3397 introduced a large number of warnings to the Windows build. This patch fixes them.

Include/pyport.h
Modules/_json.c
Modules/_pickle.c
PC/pyconfig.h

index 6c91898b44ff5b0d98a7bf0413431be869f759c1..dbf6db687681e2973dca7dcbb0f84945fb0b668f 100644 (file)
@@ -641,7 +641,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
 /* only get special linkage if built as shared or platform is Cygwin */
 #if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__)
 #       if defined(HAVE_DECLSPEC_DLL)
-#               ifdef Py_BUILD_CORE
+#               if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN)
 #                       define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
 #                       define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE
         /* module init functions inside the core need no external linkage */
@@ -773,7 +773,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
 #define PY_LITTLE_ENDIAN 1
 #endif
 
-#ifdef Py_BUILD_CORE
+#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN)
 /*
  * Macros to protect CRT calls against instant termination when passed an
  * invalid parameter (issue23524).
index f1da2302dd39cc9346a966971ba1620b6c764855..769696d9d6855869f545665483a9a991de4014b5 100644 (file)
@@ -1,7 +1,7 @@
 
 /* Core extension modules are built-in on some platforms (e.g. Windows). */
 #ifdef Py_BUILD_CORE
-#define Py_BUILD_CORE_MODULE
+#define Py_BUILD_CORE_BUILTIN
 #undef Py_BUILD_CORE
 #endif
 
index 5fbf0995f4c3e32c6ae64609a59a534d5cb97b64..bcbe4ac7945169688f8da539133b1eb67e7c2f0b 100644 (file)
@@ -1,7 +1,7 @@
 
 /* Core extension modules are built-in on some platforms (e.g. Windows). */
 #ifdef Py_BUILD_CORE
-#define Py_BUILD_CORE_MODULE
+#define Py_BUILD_CORE_BUILTIN
 #undef Py_BUILD_CORE
 #endif
 
index 4e25fbd973d0f500d35bac53991295e3ebe6bad8..db745dee7617777f4b1dd1a3fe4e70d7ab218f1f 100644 (file)
@@ -143,7 +143,7 @@ WIN32 is still required for the locale module.
    structures etc so it can optionally use new Windows features if it
    determines at runtime they are available.
 */
-#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_MODULE)
+#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN) || defined(Py_BUILD_CORE_MODULE)
 #ifndef NTDDI_VERSION
 #define NTDDI_VERSION Py_NTDDI
 #endif
@@ -277,21 +277,20 @@ Py_NO_ENABLE_SHARED to find out.  Also support MS_NO_COREDLL for b/w compat */
 
 /* For an MSVC DLL, we can nominate the .lib files used by extensions */
 #ifdef MS_COREDLL
-#       ifndef Py_BUILD_CORE /* not building the core - must be an ext */
-#               ifndef Py_BUILD_CORE_MODULE
-#                       if defined(_MSC_VER)
-                                /* So MSVC users need not specify the .lib
-                                file in their Makefile (other compilers are
-                                generally taken care of by distutils.) */
-#                               if defined(_DEBUG)
-#                                       pragma comment(lib,"python37_d.lib")
-#                               elif defined(Py_LIMITED_API)
-#                                       pragma comment(lib,"python3.lib")
-#                               else
-#                                       pragma comment(lib,"python37.lib")
-#                               endif /* _DEBUG */
-#                       endif /* _MSC_VER */
-#               endif /* Py_BUILD_CORE_MODULE */
+#       if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
+                /* not building the core - must be an ext */
+#               if defined(_MSC_VER)
+                        /* So MSVC users need not specify the .lib
+                        file in their Makefile (other compilers are
+                        generally taken care of by distutils.) */
+#                       if defined(_DEBUG)
+#                               pragma comment(lib,"python37_d.lib")
+#                       elif defined(Py_LIMITED_API)
+#                               pragma comment(lib,"python3.lib")
+#                       else
+#                               pragma comment(lib,"python37.lib")
+#                       endif /* _DEBUG */
+#               endif /* _MSC_VER */
 #       endif /* Py_BUILD_CORE */
 #endif /* MS_COREDLL */