bpo-43974: Move Py_BUILD_CORE_MODULE into module code (GH-29157)

setup.py no longer defines Py_BUILD_CORE_MODULE. Instead every
module defines the macro before #include "Python.h" unless
Py_BUILD_CORE_BUILTIN is already defined.

Py_BUILD_CORE_BUILTIN is defined for every module that is built by
Modules/Setup.

The PR also simplifies Modules/Setup. Makefile and makesetup
already define Py_BUILD_CORE_BUILTIN and include Modules/internal
for us.

Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
Christian Heimes 2021-10-22 16:36:28 +03:00 committed by GitHub
parent 86dfb55d2e
commit 03e9f5dc75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 182 additions and 86 deletions

View file

@ -13,6 +13,10 @@
* The blake2s_impl.c is autogenerated from blake2b_impl.c.
*/
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#include "Python.h"
#include "pycore_strhex.h" // _Py_strhex()

View file

@ -8,6 +8,10 @@
* any warranty. http://creativecommons.org/publicdomain/zero/1.0/
*/
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#include "Python.h"
#include "impl/blake2.h"

View file

@ -13,6 +13,10 @@
* The blake2s_impl.c is autogenerated from blake2s_impl.c.
*/
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#include "Python.h"
#include "pycore_strhex.h" // _Py_strhex()