Skip to content

Commit dbe006d

Browse files
committed
Only define _Py_ABI_SLOT as a part of the internal C API
1 parent ba7112e commit dbe006d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Include/cpython/modsupport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ typedef struct _PyArg_Parser {
3838
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
3939
struct _PyArg_Parser *, ...);
4040

41+
#ifdef Py_BUILD_CORE
4142
// For internal use in stdlib. Needs C99 compound literals.
4243
// Defined here to avoid every stdlib module including pycore_modsupport.h
4344
#define _Py_ABI_SLOT {Py_mod_abi, (void*) &(PyABIInfo) _PyABIInfo_DEFAULT}
45+
#endif

Modules/_xxtestfuzz/_xxtestfuzz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ static PyMethodDef module_methods[] = {
2828
{NULL},
2929
};
3030

31+
PyABIInfo_VAR(abi_info);
32+
3133
static PyModuleDef_Slot module_slots[] = {
32-
_Py_ABI_SLOT,
34+
{Py_mod_abi, &abi_info},
3335
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
3436
{0, NULL},
3537
};

Modules/xxsubtype.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ xxsubtype_exec(PyObject* m)
301301
return 0;
302302
}
303303

304+
PyABIInfo_VAR(abi_info);
305+
304306
static struct PyModuleDef_Slot xxsubtype_slots[] = {
305-
_Py_ABI_SLOT,
307+
{Py_mod_abi, &abi_info},
306308
{Py_mod_exec, xxsubtype_exec},
307309
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
308310
{Py_mod_gil, Py_MOD_GIL_NOT_USED},

0 commit comments

Comments
 (0)