diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-04-17 21:02:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-17 21:02:26 (GMT) |
commit | 5c75f37d473140f0e0b7d9bf3a8c08343447ded1 (patch) | |
tree | 9c2ce8ff92bf17d73dfe14c7d7027a36693b590d /Python/ceval.c | |
parent | 3092d6b2630e4d2bd200fbc3231c27a7cba4d6b2 (diff) | |
download | cpython-5c75f37d473140f0e0b7d9bf3a8c08343447ded1.zip cpython-5c75f37d473140f0e0b7d9bf3a8c08343447ded1.tar.gz cpython-5c75f37d473140f0e0b7d9bf3a8c08343447ded1.tar.bz2 |
bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)
Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros
of pyport.h when Py_BUILD_CORE_MODULE is defined.
The Py_BUILD_CORE_MODULE define must be now be used to build a C
extension as a dynamic library accessing Python internals: export the
PyInit_xxx() function in DLL exports on Windows.
Changes:
* Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply
Py_BUILD_CORE directy in pyport.h.
* ceval.c compilation now fails with an error if Py_BUILD_CORE is not
defined, just to ensure that Python is build with the correct
defines.
* setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define.
* setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather
than Py_BUILD_CORE_BUILTIN define
* PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 28e9232..342dc10 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -30,6 +30,10 @@ #define CHECKEXC 1 /* Double-check exception checking */ #endif +#if !defined(Py_BUILD_CORE) +# error "ceval.c must be build with Py_BUILD_CORE define for best performance" +#endif + /* Private API for the LOAD_METHOD opcode. */ extern int _PyObject_GetMethod(PyObject *, PyObject *, PyObject **); |