]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668)
authorVictor Stinner <vstinner@python.org>
Thu, 3 Mar 2022 22:06:55 +0000 (23:06 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 22:06:55 +0000 (23:06 +0100)
Move the type definition to pytypedefs.h.

Include/moduleobject.h
Include/pytypedefs.h

index 2d41f76df4b22f644b69812c35d738516ac77705..8b62c45505fb6178e9db38aedf49a9b3e72de508 100644 (file)
@@ -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
index 5dd841e62173cbbef151c428d8db1ebdda9c764e..e78ed56a3b67cd19a6fbce550cb9b145c719ed31 100644 (file)
@@ -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;