Skip to content

Commit 5aeb872

Browse files
committed
BLD: Check for sufficient MinGW headers when using them
1 parent dd81b66 commit 5aeb872

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/_tkagg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ static inline PyObject *PyErr_SetFromWindowsErr(int ierr) {
5353
#include <psapi.h> // Must be linked with 'psapi' library
5454
#define dlsym GetProcAddress
5555
#define UNUSED_ON_NON_WINDOWS(x) x
56+
// Check for old headers that do not defined HiDPI functions and constants.
57+
#if defined(__MINGW64_VERSION_MAJOR)
58+
static_assert(__MINGW64_VERSION_MAJOR >= 6,
59+
"mingw-w64-x86_64-headers >= 6 are required when compiling with MinGW");
60+
#endif
5661
#else
5762
#include <dlfcn.h>
5863
#define UNUSED_ON_NON_WINDOWS Py_UNUSED

0 commit comments

Comments
 (0)