File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ extern "C" {
30
30
# define _Py_CAST (type, expr ) ((type)(expr))
31
31
#endif
32
32
33
- // On C++11 and newer, _Py_NULL is defined as nullptr on C++11,
34
- // otherwise it is defined as NULL.
35
- # ifndef _Py_NULL
36
- # if defined(__cplusplus ) && __cplusplus >= 201103
37
- # define _Py_NULL nullptr
38
- # else
39
- # define _Py_NULL NULL
40
- # endif
33
+ // Static inline functions should use _Py_NULL rather than using directly NULL
34
+ // to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
35
+ // _Py_NULL is defined as nullptr.
36
+ #if ( defined (__STDC_VERSION__ ) && __STDC_VERSION__ > 201710L) \
37
+ || (defined(__cplusplus) && __cplusplus >= 201103 )
38
+ # define _Py_NULL nullptr
39
+ #else
40
+ # define _Py_NULL NULL
41
41
#endif
42
42
43
43
// Cast argument to PyObject* type.
You can’t perform that action at this time.
0 commit comments