https://github.com/python/cpython/commit/8594d2c03dccd9731e9fc83a9fe6a19a3a090cb7
commit: 8594d2c03dccd9731e9fc83a9fe6a19a3a090cb7
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2025-06-26T18:11:49+02:00
summary:

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

files:
M Include/pyport.h

diff --git a/Include/pyport.h b/Include/pyport.h
index 73f071c41a6687..0675294d5bc3b1 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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to