From: Victor Stinner Date: Thu, 3 Mar 2022 22:06:55 +0000 (+0100) Subject: bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668) X-Git-Tag: v3.11.0a6~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b63215bb152c06404cecbd5303b1a50969a9f9f;p=thirdparty%2FPython%2Fcpython.git bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668) Move the type definition to pytypedefs.h. --- diff --git a/Include/moduleobject.h b/Include/moduleobject.h index 2d41f76df4b2..8b62c45505fb 100644 --- a/Include/moduleobject.h +++ b/Include/moduleobject.h @@ -55,14 +55,12 @@ typedef struct PyModuleDef_Base { NULL, /* m_copy */ \ } -struct PyModuleDef_Slot; - #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 /* New in 3.5 */ -typedef struct PyModuleDef_Slot{ +struct PyModuleDef_Slot { int slot; void *value; -} PyModuleDef_Slot; +}; #define Py_mod_create 1 #define Py_mod_exec 2 diff --git a/Include/pytypedefs.h b/Include/pytypedefs.h index 5dd841e62173..e78ed56a3b67 100644 --- a/Include/pytypedefs.h +++ b/Include/pytypedefs.h @@ -10,6 +10,7 @@ extern "C" { #endif typedef struct PyModuleDef PyModuleDef; +typedef struct PyModuleDef_Slot PyModuleDef_Slot; typedef struct PyMethodDef PyMethodDef; typedef struct PyGetSetDef PyGetSetDef; typedef struct PyMemberDef PyMemberDef;