https://github.com/python/cpython/commit/6ed9be1a553e1b6d63410348549fb033f6220d88
commit: 6ed9be1a553e1b6d63410348549fb033f6220d88
branch: 3.14
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2025-10-07T18:41:45+02:00
summary:

[3.14] gh-137058: Sync _Py_NULL macro with the main branch (#137409)

gh-137058: Sync _Py_NULL macro with the main branch

* use __STDC_VERSION__ >= 202311L instead of
  __STDC_VERSION__ > 201710L.
* Check for _MSC_VER.

files:
M Include/pyport.h

diff --git a/Include/pyport.h b/Include/pyport.h
index 3eac119bf8e8d8..44894419f6231d 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -49,8 +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 (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
-        || (defined(__cplusplus) && __cplusplus >= 201103)
+#if !defined(_MSC_VER) && \
+    ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) \
+        || (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