From: Victor Stinner Date: Thu, 26 Jun 2025 16:11:49 +0000 (+0200) Subject: gh-135927: Check _MSC_VER to define _Py_NULL macro (#135987) X-Git-Tag: v3.15.0a1~1171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8594d2c03dccd9731e9fc83a9fe6a19a3a090cb7;p=thirdparty%2FPython%2Fcpython.git gh-135927: Check _MSC_VER to define _Py_NULL macro (#135987) --- diff --git a/Include/pyport.h b/Include/pyport.h index 73f071c41a66..0675294d5bc3 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -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