mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00

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.
42 lines
779 B
C
42 lines
779 B
C
#ifndef Py_INTERNAL_CONTEXT_H
|
|
#define Py_INTERNAL_CONTEXT_H
|
|
|
|
#ifndef Py_BUILD_CORE
|
|
# error "this header requires Py_BUILD_CORE define"
|
|
#endif
|
|
|
|
#include "pycore_hamt.h"
|
|
|
|
struct _pycontextobject {
|
|
PyObject_HEAD
|
|
PyContext *ctx_prev;
|
|
PyHamtObject *ctx_vars;
|
|
PyObject *ctx_weakreflist;
|
|
int ctx_entered;
|
|
};
|
|
|
|
|
|
struct _pycontextvarobject {
|
|
PyObject_HEAD
|
|
PyObject *var_name;
|
|
PyObject *var_default;
|
|
PyObject *var_cached;
|
|
uint64_t var_cached_tsid;
|
|
uint64_t var_cached_tsver;
|
|
Py_hash_t var_hash;
|
|
};
|
|
|
|
|
|
struct _pycontexttokenobject {
|
|
PyObject_HEAD
|
|
PyContext *tok_ctx;
|
|
PyContextVar *tok_var;
|
|
PyObject *tok_oldval;
|
|
int tok_used;
|
|
};
|
|
|
|
|
|
int _PyContext_Init(void);
|
|
void _PyContext_Fini(void);
|
|
|
|
#endif /* !Py_INTERNAL_CONTEXT_H */
|