gh-107211: No longer export internal variables (#107218)

No longer export these 5 internal C API variables:

* _PyBufferWrapper_Type
* _PyImport_FrozenBootstrap
* _PyImport_FrozenStdlib
* _PyImport_FrozenTest
* _Py_SwappedOp

Fix the definition of these internal functions, replace PyAPI_DATA()
with PyAPI_FUNC():

* _PyImport_ClearExtension()
* _PyObject_IsFreed()
* _PyThreadState_GetCurrent()
This commit is contained in:
Victor Stinner 2023-07-25 05:48:04 +02:00 committed by GitHub
parent c5b13d6f80
commit 3b309319cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 20 deletions

View file

@ -187,9 +187,13 @@ struct _module_alias {
const char *orig; /* ASCII encoded string */
};
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenBootstrap;
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenStdlib;
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenTest;
// Export for test_ctypes
PyAPI_DATA(const struct _frozen*) _PyImport_FrozenBootstrap;
// Export for test_ctypes
PyAPI_DATA(const struct _frozen*) _PyImport_FrozenStdlib;
// Export for test_ctypes
PyAPI_DATA(const struct _frozen*) _PyImport_FrozenTest;
extern const struct _module_alias * _PyImport_FrozenAliases;
extern int _PyImport_CheckSubinterpIncompatibleExtensionAllowed(
@ -197,7 +201,7 @@ extern int _PyImport_CheckSubinterpIncompatibleExtensionAllowed(
// Export for '_testinternalcapi' shared extension
PyAPI_DATA(int) _PyImport_ClearExtension(PyObject *name, PyObject *filename);
PyAPI_FUNC(int) _PyImport_ClearExtension(PyObject *name, PyObject *filename);
#ifdef __cplusplus
}