Skip to content

Commit f1f10ff

Browse files
Fix includes in builtin extensions on Windows.
1 parent 72d7251 commit f1f10ff

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

Modules/_json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* Core extension modules are built-in on some platforms (e.g. Windows). */
33
#ifdef Py_BUILD_CORE
4+
#define Py_BUILD_CORE_MODULE
45
#undef Py_BUILD_CORE
56
#endif
67

Modules/_pickle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
/* Core extension modules are built-in on some platforms (e.g. Windows). */
33
#ifdef Py_BUILD_CORE
4+
#define Py_BUILD_CORE_MODULE
45
#undef Py_BUILD_CORE
56
#endif
67

PC/pyconfig.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,18 +278,20 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
278278
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
279279
#ifdef MS_COREDLL
280280
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
281-
# if defined(_MSC_VER)
282-
/* So MSVC users need not specify the .lib file in
283-
their Makefile (other compilers are generally
284-
taken care of by distutils.) */
285-
# if defined(_DEBUG)
286-
# pragma comment(lib,"python37_d.lib")
287-
# elif defined(Py_LIMITED_API)
288-
# pragma comment(lib,"python3.lib")
289-
# else
290-
# pragma comment(lib,"python37.lib")
291-
# endif /* _DEBUG */
292-
# endif /* _MSC_VER */
281+
# ifndef Py_BUILD_CORE_MODULE
282+
# if defined(_MSC_VER)
283+
/* So MSVC users need not specify the .lib
284+
file in their Makefile (other compilers are
285+
generally taken care of by distutils.) */
286+
# if defined(_DEBUG)
287+
# pragma comment(lib,"python37_d.lib")
288+
# elif defined(Py_LIMITED_API)
289+
# pragma comment(lib,"python3.lib")
290+
# else
291+
# pragma comment(lib,"python37.lib")
292+
# endif /* _DEBUG */
293+
# endif /* _MSC_VER */
294+
# endif /* Py_BUILD_CORE_MODULE */
293295
# endif /* Py_BUILD_CORE */
294296
#endif /* MS_COREDLL */
295297

Programs/_testembed.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <Python.h>
2-
#include "internal/pystate.h"
32
#include <inttypes.h>
43
#include <stdio.h>
54

Programs/python.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* Minimal main program -- everything is loaded from the library */
22

33
#include "Python.h"
4-
#include "internal/pystate.h"
54
#include <locale.h>
65

76
#ifdef __FreeBSD__

0 commit comments

Comments
 (0)