We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c84545f commit 632d1aaCopy full SHA for 632d1aa
pythoncapi_compat.h
@@ -37,11 +37,13 @@ extern "C" {
37
// Static inline functions should use _Py_NULL rather than using directly NULL
38
// to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
39
// _Py_NULL is defined as nullptr.
40
-#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
41
- || (defined(__cplusplus) && __cplusplus >= 201103)
42
-# define _Py_NULL nullptr
43
-#else
44
-# define _Py_NULL NULL
+#ifndef _Py_NULL
+# if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
+ || (defined(__cplusplus) && __cplusplus >= 201103)
+# define _Py_NULL nullptr
+# else
45
+# define _Py_NULL NULL
46
+# endif
47
#endif
48
49
// Cast argument to PyObject* type.
0 commit comments