summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Setup14
-rw-r--r--Modules/_json.c13
-rw-r--r--Modules/_pickle.c11
-rw-r--r--Modules/_testcapimodule.c5
4 files changed, 27 insertions, 16 deletions
diff --git a/Modules/Setup b/Modules/Setup
index 11ddd0c7b2..03aa0f16be 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -101,29 +101,29 @@ PYTHONPATH=$(COREPYTHONPATH)
# This only contains the minimal set of modules required to run the
# setup.py script in the root of the Python source tree.
-posix -DPy_BUILD_CORE -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
+posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
errno errnomodule.c # posix (UNIX) errno values
pwd pwdmodule.c # this is needed to find out the user's home dir
# if $HOME is not set
_sre _sre.c # Fredrik Lundh's new regular expressions
_codecs _codecsmodule.c # access to the builtin codecs and codec registry
_weakref _weakref.c # weak references
-_functools -DPy_BUILD_CORE -I$(srcdir)/Include/internal _functoolsmodule.c # Tools for working with functions and callable objects
+_functools -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _functoolsmodule.c # Tools for working with functions and callable objects
_operator _operator.c # operator.add() and similar goodies
_collections _collectionsmodule.c # Container types
_abc _abc.c # Abstract base classes
itertools itertoolsmodule.c # Functions creating iterators for efficient looping
atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
-_signal -DPy_BUILD_CORE -I$(srcdir)/Include/internal signalmodule.c
+_signal -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal signalmodule.c
_stat _stat.c # stat.h interface
-time -DPy_BUILD_CORE -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables
-_thread -DPy_BUILD_CORE -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface
+time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal timemodule.c # -lm # time operations and variables
+_thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # low-level threading interface
# access to ISO C locale support
-_locale -DPy_BUILD_CORE _localemodule.c # -lintl
+_locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl
# Standard I/O baseline
-_io -DPy_BUILD_CORE -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
+_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
# faulthandler module
faulthandler faulthandler.c
diff --git a/Modules/_json.c b/Modules/_json.c
index 94a7c0d2bf..2d7c1bf1e1 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -1,8 +1,11 @@
-
-/* Core extension modules are built-in on some platforms (e.g. Windows). */
-#ifdef Py_BUILD_CORE
-#define Py_BUILD_CORE_BUILTIN
-#undef Py_BUILD_CORE
+/* JSON accelerator C extensor: _json module.
+ *
+ * It is built as a built-in module (Py_BUILD_CORE_BUILTIN define) on Windows
+ * and as an extension module (Py_BUILD_CORE_MODULE define) on other
+ * platforms. */
+
+#if !defined(Py_BUILD_CORE_BUILTIN) && !defined(Py_BUILD_CORE_MODULE)
+# error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined"
#endif
#include "Python.h"
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 2b97294e1e..f956a382ac 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1,8 +1,11 @@
+/* pickle accelerator C extensor: _pickle module.
+ *
+ * It is built as a built-in module (Py_BUILD_CORE_BUILTIN define) on Windows
+ * and as an extension module (Py_BUILD_CORE_MODULE define) on other
+ * platforms. */
-/* Core extension modules are built-in on some platforms (e.g. Windows). */
-#ifdef Py_BUILD_CORE
-#define Py_BUILD_CORE_BUILTIN
-#undef Py_BUILD_CORE
+#if !defined(Py_BUILD_CORE_BUILTIN) && !defined(Py_BUILD_CORE_MODULE)
+# error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined"
#endif
#include "Python.h"
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 1180b4b176..ae960deba7 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -5,6 +5,11 @@
* standard Python regression test, via Lib/test/test_capi.py.
*/
+/* The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE
+ define, but we only want to test the public C API, not the internal
+ C API. */
+#undef Py_BUILD_CORE_MODULE
+
#define PY_SSIZE_T_CLEAN
#include "Python.h"