Skip to content

Commit 3a35b62

Browse files
authored
gh-91321: Fix PyModuleDef_HEAD_INIT on C++ (#92259)
The PyModuleDef_HEAD_INIT macro now uses _Py_NULL to fix C++ compiler warnings when using it in C++.
1 parent d9ec553 commit 3a35b62

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Include/moduleobject.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ typedef struct PyModuleDef_Base {
4848
PyObject* m_copy;
4949
} PyModuleDef_Base;
5050

51-
#define PyModuleDef_HEAD_INIT { \
52-
PyObject_HEAD_INIT(NULL) \
53-
NULL, /* m_init */ \
54-
0, /* m_index */ \
55-
NULL, /* m_copy */ \
51+
#define PyModuleDef_HEAD_INIT { \
52+
PyObject_HEAD_INIT(_Py_NULL) \
53+
_Py_NULL, /* m_init */ \
54+
0, /* m_index */ \
55+
_Py_NULL, /* m_copy */ \
5656
}
5757

5858
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000

0 commit comments

Comments
 (0)