Skip to content

Commit 0b63215

Browse files
authored
bpo-45459: Fix PyModuleDef_Slot type in the limited C API (GH-31668)
Move the type definition to pytypedefs.h.
1 parent 4173d67 commit 0b63215

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Include/moduleobject.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ typedef struct PyModuleDef_Base {
5555
NULL, /* m_copy */ \
5656
}
5757

58-
struct PyModuleDef_Slot;
59-
6058
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
6159
/* New in 3.5 */
62-
typedef struct PyModuleDef_Slot{
60+
struct PyModuleDef_Slot {
6361
int slot;
6462
void *value;
65-
} PyModuleDef_Slot;
63+
};
6664

6765
#define Py_mod_create 1
6866
#define Py_mod_exec 2

Include/pytypedefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extern "C" {
1010
#endif
1111

1212
typedef struct PyModuleDef PyModuleDef;
13+
typedef struct PyModuleDef_Slot PyModuleDef_Slot;
1314
typedef struct PyMethodDef PyMethodDef;
1415
typedef struct PyGetSetDef PyGetSetDef;
1516
typedef struct PyMemberDef PyMemberDef;

0 commit comments

Comments
 (0)