Skip to content

Commit 6ed9be1

Browse files
authored
[3.14] gh-137058: Sync _Py_NULL macro with the main branch (#137409)
gh-137058: Sync _Py_NULL macro with the main branch * use __STDC_VERSION__ >= 202311L instead of __STDC_VERSION__ > 201710L. * Check for _MSC_VER.
1 parent 4319884 commit 6ed9be1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Include/pyport.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949
// Static inline functions should use _Py_NULL rather than using directly NULL
5050
// to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
5151
// _Py_NULL is defined as nullptr.
52-
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
53-
|| (defined(__cplusplus) && __cplusplus >= 201103)
52+
#if !defined(_MSC_VER) && \
53+
((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) \
54+
|| (defined(__cplusplus) && __cplusplus >= 201103))
5455
# define _Py_NULL nullptr
5556
#else
5657
# define _Py_NULL NULL

0 commit comments

Comments
 (0)