]> granicus.if.org Git - python/commit
bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)
authorVictor Stinner <vstinner@redhat.com>
Wed, 17 Apr 2019 21:02:26 +0000 (23:02 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Apr 2019 21:02:26 +0000 (23:02 +0200)
commit5c75f37d473140f0e0b7d9bf3a8c08343447ded1
tree9c2ce8ff92bf17d73dfe14c7d7027a36693b590d
parent3092d6b2630e4d2bd200fbc3231c27a7cba4d6b2
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.
26 files changed:
Include/internal/pycore_accu.h
Include/internal/pycore_atomic.h
Include/internal/pycore_ceval.h
Include/internal/pycore_condvar.h
Include/internal/pycore_context.h
Include/internal/pycore_coreconfig.h
Include/internal/pycore_getopt.h
Include/internal/pycore_gil.h
Include/internal/pycore_hamt.h
Include/internal/pycore_object.h
Include/internal/pycore_pathconfig.h
Include/internal/pycore_pyhash.h
Include/internal/pycore_pylifecycle.h
Include/internal/pycore_pymem.h
Include/internal/pycore_pystate.h
Include/internal/pycore_tupleobject.h
Include/internal/pycore_warnings.h
Include/pyport.h
Misc/NEWS.d/next/Build/2019-04-16-13-58-52.bpo-36635.JKlzkf.rst [new file with mode: 0644]
Modules/Setup
Modules/_json.c
Modules/_pickle.c
Modules/_testcapimodule.c
PCbuild/pythoncore.vcxproj
Python/ceval.c
setup.py