File tree 2 files changed +17
-3
lines changed 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -396,8 +396,8 @@ def get_extensions(self):
396
396
include_dirs = ["src" ],
397
397
# psapi library needed for finding Tcl/Tk at run time.
398
398
# user32 library needed for window manipulation functions.
399
- libraries = ({"linux" : ["dl" ], "win32" : ["psapi" , "user32" ]}
400
- .get (sys .platform , [])),
399
+ libraries = ({"linux" : ["dl" ], "win32" : ["psapi" , "user32" ],
400
+ "cygwin" : [ "psapi" ]} .get (sys .platform , [])),
401
401
extra_link_args = {"win32" : ["-mwindows" ]}.get (sys .platform , []))
402
402
add_numpy_flags (ext )
403
403
add_libagg_flags (ext )
Original file line number Diff line number Diff line change 11
11
#include < Python.h>
12
12
13
13
#ifdef _WIN32
14
+ #define WIN32_DLL
15
+ #endif
16
+ #ifdef __CYGWIN__
17
+ /*
18
+ * Unfortunately cygwin's libdl inherits restrictions from the underlying
19
+ * Windows OS, at least currently. Therefore, a symbol may be loaded from a
20
+ * module by dlsym() only if it is really located in the given modile,
21
+ * dependencies are not included. So we have to use native WinAPI on Cygwin
22
+ * also.
23
+ */
24
+ #define WIN32_DLL
25
+ #endif
26
+
27
+ #ifdef WIN32_DLL
14
28
#include < windows.h>
15
29
#define PSAPI_VERSION 1
16
30
#include < psapi.h> // Must be linked with 'psapi' library
@@ -122,7 +136,7 @@ int load_tk(T lib)
122
136
(Tk_PhotoPutBlock_NoComposite_t)dlsym (lib, " Tk_PhotoPutBlock_NoComposite" ));
123
137
}
124
138
125
- #ifdef _WIN32
139
+ #ifdef WIN32_DLL
126
140
127
141
/*
128
142
* On Windows, we can't load the tkinter module to get the Tk symbols, because
You can’t perform that action at this time.
0 commit comments