]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-135927: Check _MSC_VER to define _Py_NULL macro (#135987)
authorVictor Stinner <vstinner@python.org>
Thu, 26 Jun 2025 16:11:49 +0000 (18:11 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 16:11:49 +0000 (18:11 +0200)
Include/pyport.h

index 73f071c41a66875e970f4bf578d5a2f0caf13eff..0675294d5bc3b1d18996c1158cf458c195edf735 100644 (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