From a49192a135606f36ac75ef80050ac99f9350d613 Mon Sep 17 00:00:00 2001 From: GalaxySnail Date: Fri, 9 Dec 2022 22:32:10 +0800 Subject: [PATCH 1/3] define MS_WIN64 for 64bit mingw-w64 --- PC/pyconfig.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 1a33d4c5a1e4fc..08a26722b0b18f 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -209,6 +209,24 @@ typedef int pid_t; #endif /* _MSC_VER */ +/* ------------------------------------------------------------------------*/ +/* mingw and mingw-w64 define __MINGW32__ */ +#ifdef __MINGW32__ + +#if !defined(MS_WIN64) && defined(_WIN64) +#define MS_WIN64 +#endif + +#if !defined(MS_WIN32) && defined(_WIN32) +#define MS_WIN32 +#endif + +#if !defined(MS_WINDOWS) && defined(MS_WIN32) +#define MS_WINDOWS +#endif + +#endif /* __MINGW32__*/ + /* ------------------------------------------------------------------------*/ /* egcs/gnu-win32 defines __GNUC__ and _WIN32 */ #if defined(__GNUC__) && defined(_WIN32) From ae6ab60370b31d2b8e4dfdc6e802fa5a178f33c8 Mon Sep 17 00:00:00 2001 From: GalaxySnail Date: Fri, 9 Dec 2022 22:48:33 +0800 Subject: [PATCH 2/3] add NEWS --- .../next/Windows/2022-12-09-22-47-42.gh-issue-79218.Yiot2e.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Windows/2022-12-09-22-47-42.gh-issue-79218.Yiot2e.rst diff --git a/Misc/NEWS.d/next/Windows/2022-12-09-22-47-42.gh-issue-79218.Yiot2e.rst b/Misc/NEWS.d/next/Windows/2022-12-09-22-47-42.gh-issue-79218.Yiot2e.rst new file mode 100644 index 00000000000000..e2e6ca3c7796e0 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2022-12-09-22-47-42.gh-issue-79218.Yiot2e.rst @@ -0,0 +1 @@ +Define ``MS_WIN64`` for Mingw-w64 64bit, fix cython compilation failure. From ae312e4d2bcfbf9a5bead1d9376af4a9d89346e2 Mon Sep 17 00:00:00 2001 From: GalaxySnail Date: Fri, 9 Dec 2022 23:32:06 +0800 Subject: [PATCH 3/3] only define `MS_WIN64` --- PC/pyconfig.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 08a26722b0b18f..1d8408b363a66a 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -213,18 +213,10 @@ typedef int pid_t; /* mingw and mingw-w64 define __MINGW32__ */ #ifdef __MINGW32__ -#if !defined(MS_WIN64) && defined(_WIN64) +#ifdef _WIN64 #define MS_WIN64 #endif -#if !defined(MS_WIN32) && defined(_WIN32) -#define MS_WIN32 -#endif - -#if !defined(MS_WINDOWS) && defined(MS_WIN32) -#define MS_WINDOWS -#endif - #endif /* __MINGW32__*/ /* ------------------------------------------------------------------------*/