Skip to content

bpo-45459: Fix PyModuleDef_Slot type in the limited C API #31668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Include/moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Include/pytypedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down