@@ -102,6 +102,23 @@ WIN32 is still required for the locale module.
102102/* #define Py_GIL_DISABLED 1 */
103103#endif
104104
105+ /* Defined in debug builds */
106+ #ifdef _DEBUG
107+ # define Py_DEBUG
108+ #endif
109+
110+ #ifdef Py_GIL_DISABLED
111+ # define _ABIFLAGS_FREETHREADED "t"
112+ #else
113+ # define _ABIFLAGS_FREETHREADED ""
114+ #endif
115+ #ifdef Py_DEBUG
116+ # define _ABIFLAGS_DEBUG "d"
117+ #else
118+ # define _ABIFLAGS_DEBUG ""
119+ #endif
120+ #define ABIFLAGS ("" _Py_STRINGIZE(_ABIFLAGS_FREETHREADED) _Py_STRINGIZE(_ABIFLAGS_DEBUG))
121+
105122/* Compiler specific defines */
106123
107124/* ------------------------------------------------------------------------*/
@@ -315,21 +332,21 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
315332 /* So MSVC users need not specify the .lib
316333 file in their Makefile */
317334# if defined(Py_GIL_DISABLED )
318- # if defined(_DEBUG )
335+ # if defined(Py_DEBUG )
319336# pragma comment(lib,"python314t_d.lib")
320337# elif defined(Py_LIMITED_API )
321338# pragma comment(lib,"python3t.lib")
322339# else
323340# pragma comment(lib,"python314t.lib")
324- # endif /* _DEBUG */
341+ # endif /* Py_DEBUG */
325342# else /* Py_GIL_DISABLED */
326- # if defined(_DEBUG )
343+ # if defined(Py_DEBUG )
327344# pragma comment(lib,"python314_d.lib")
328345# elif defined(Py_LIMITED_API )
329346# pragma comment(lib,"python3.lib")
330347# else
331348# pragma comment(lib,"python314.lib")
332- # endif /* _DEBUG */
349+ # endif /* Py_DEBUG */
333350# endif /* Py_GIL_DISABLED */
334351# endif /* _MSC_VER */
335352# endif /* Py_BUILD_CORE */
@@ -372,11 +389,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
372389# define ALIGNOF_MAX_ALIGN_T 8
373390#endif
374391
375- #ifdef _DEBUG
376- # define Py_DEBUG
377- #endif
378-
379-
380392#ifdef MS_WIN32
381393
382394#define SIZEOF_SHORT 2
0 commit comments