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

@ -15,6 +15,9 @@
*/
/* SHA objects */
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#include "Python.h"
#include "pycore_bitutils.h" // _Py_bswap32()