Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-135927: Check _MSC_VER to define _Py_NULL macro
  • Loading branch information
vstinner committed Jun 26, 2025
commit 9b7cbca070655b42e775c53d3c0e9db469deef09
6 changes: 3 additions & 3 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading