Skip to content

Commit caf9902

Browse files
Alexpuxlazka
andcommitted
Define MS_WINDOWS (and others) when compiling with MINGW
This is used throughout the Python code but is not defined when compiling with Mingw-w64 compilers, so define it. Co-authored-by: Алексей <alexey.pawlow@gmail.com> Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
1 parent 3dca801 commit caf9902

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Include/pyport.h

+15
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@
5353
#endif
5454

5555

56+
#ifdef __MINGW32__
57+
/* Translate GCC[mingw*] platform specific defines to those
58+
* used in python code.
59+
*/
60+
#if !defined(MS_WIN64) && defined(_WIN64)
61+
# define MS_WIN64
62+
#endif
63+
#if !defined(MS_WIN32) && defined(_WIN32)
64+
# define MS_WIN32
65+
#endif
66+
#if !defined(MS_WINDOWS) && defined(MS_WIN32)
67+
# define MS_WINDOWS
68+
#endif
69+
#endif /* __MINGW32__*/
70+
5671
/**************************************************************************
5772
Symbols and macros to supply platform-independent interfaces to basic
5873
C language & library operations whose spellings vary across platforms.

0 commit comments

Comments
 (0)