Skip to content

Commit 8594d2c

Browse files
authored
gh-135927: Check _MSC_VER to define _Py_NULL macro (#135987)
1 parent a4625d5 commit 8594d2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Include/pyport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +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(__GNUC__) || defined(__clang__)) && \
53-
(defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
54-
|| (defined(__cplusplus) && __cplusplus >= 201103)
52+
#if !defined(_MSC_VER) && \
53+
((defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
54+
|| (defined(__cplusplus) && __cplusplus >= 201103))
5555
# define _Py_NULL nullptr
5656
#else
5757
# define _Py_NULL NULL

0 commit comments

Comments
 (0)