mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-135927: Check _MSC_VER to define _Py_NULL macro (#135987)
This commit is contained in:
parent
a4625d597f
commit
8594d2c03d
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue