summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-03 20:40:20 (GMT)
committerGitHub <noreply@github.com>2022-05-03 20:40:20 (GMT)
commit3a35b62ea003182c643516098cc781944d425800 (patch)
treed6d5564c73f17baaa08069c4273b0769934b75ae /Include
parentd9ec55319422cf2ba8495b2b7859749d3d742291 (diff)
downloadcpython-3a35b62ea003182c643516098cc781944d425800.zip
cpython-3a35b62ea003182c643516098cc781944d425800.tar.gz
cpython-3a35b62ea003182c643516098cc781944d425800.tar.bz2
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++.
Diffstat (limited to 'Include')
-rw-r--r--Include/moduleobject.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index 8b62c45..75abd2c 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -48,11 +48,11 @@ typedef struct PyModuleDef_Base {
PyObject* m_copy;
} PyModuleDef_Base;
-#define PyModuleDef_HEAD_INIT { \
- PyObject_HEAD_INIT(NULL) \
- NULL, /* m_init */ \
- 0, /* m_index */ \
- NULL, /* m_copy */ \
+#define PyModuleDef_HEAD_INIT { \
+ PyObject_HEAD_INIT(_Py_NULL) \
+ _Py_NULL, /* m_init */ \
+ 0, /* m_index */ \
+ _Py_NULL, /* m_copy */ \
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000