mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
3092d6b263
commit
5c75f37d47
26 changed files with 96 additions and 55 deletions
|
@ -9,8 +9,8 @@ extern "C" {
|
|||
*** Its definition may be changed or removed at any moment.
|
||||
***/
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "dynamic_annotations.h"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pycore_atomic.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef Py_INTERNAL_CONDVAR_H
|
||||
#define Py_INTERNAL_CONDVAR_H
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX_THREADS
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef Py_INTERNAL_CONTEXT_H
|
||||
#define Py_INTERNAL_CONTEXT_H
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pycore_hamt.h"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef Py_INTERNAL_PYGETOPT_H
|
||||
#define Py_INTERNAL_PYGETOPT_H
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
extern int _PyOS_opterr;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pycore_condvar.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef Py_INTERNAL_HAMT_H
|
||||
#define Py_INTERNAL_HAMT_H
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#define _Py_HAMT_MAX_TREE_DEPTH 7
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "pycore_pystate.h" /* _PyRuntime */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
typedef struct _PyPathConfig {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef Py_INTERNAL_HASH_H
|
||||
#define Py_INTERNAL_HASH_H
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
uint64_t _Py_KeyedHash(uint64_t, const char *, Py_ssize_t);
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
/* True if the main interpreter thread exited due to an unhandled
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "objimpl.h"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "cpython/coreconfig.h"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "tupleobject.h"
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
|
||||
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN define"
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
#include "object.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue