gh-135927: Check _MSC_VER to define _Py_NULL macro (#135987)

This commit is contained in:
Victor Stinner 2025-06-26 18:11:49 +02:00 committed by GitHub
parent a4625d597f
commit 8594d2c03d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,9 +49,9 @@
// Static inline functions should use _Py_NULL rather than using directly NULL
// to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
// _Py_NULL is defined as nullptr.
#if (defined(__GNUC__) || defined(__clang__)) && \
(defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
|| (defined(__cplusplus) && __cplusplus >= 201103)
#if !defined(_MSC_VER) && \
((defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
|| (defined(__cplusplus) && __cplusplus >= 201103))
# define _Py_NULL nullptr
#else
# define _Py_NULL NULL