diff --git a/Include/pymacro.h b/Include/pymacro.h index 73521be00fcd1a..16589ffe0fdd35 100644 --- a/Include/pymacro.h +++ b/Include/pymacro.h @@ -1,13 +1,6 @@ #ifndef Py_PYMACRO_H #define Py_PYMACRO_H -// _Py_STDC_VERSION: the version of the C standard. -// gh-160208: The C++ standard allows __STDC_VERSION__ to be defined to an -// arbitrary value, which means we can't use __STDC_VERSION__ on C++. -#if !defined(__cplusplus) && defined(__STDC_VERSION__) -# define _Py_STDC_VERSION __STDC_VERSION__ -#endif - // gh-91782: On FreeBSD 12, if the _POSIX_C_SOURCE and _XOPEN_SOURCE macros are // defined, disables C11 support and does not define // the static_assert() macro. diff --git a/Include/pyport.h b/Include/pyport.h index 3de7fb3d317521..e742ecd37d3305 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -8,6 +8,13 @@ # error "Python's source code assumes C's unsigned char is an 8-bit type" #endif +// _Py_STDC_VERSION: the version of the C standard. +// gh-160208: The C++ standard allows __STDC_VERSION__ to be defined to an +// arbitrary value, which means we can't use __STDC_VERSION__ on C++. +#if defined(__STDC_VERSION__) && !defined(__cplusplus) +# define _Py_STDC_VERSION __STDC_VERSION__ +#endif + // Preprocessor check for a builtin preprocessor function. Always return 0 // if __has_builtin() macro is not defined.