File tree 2 files changed +18
-4
lines changed
2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 7
7
#define WIN32_LEAN_AND_MEAN
8
8
// Windows 10, for latest HiDPI API support.
9
9
#define WINVER 0x0A00
10
- #define _WIN32_WINNT 0x0A00
10
+ #if defined(_WIN32_WINNT)
11
+ #if _WIN32_WINNT < WINVER
12
+ #undef _WIN32_WINNT
13
+ #define _WIN32_WINNT WINVER
14
+ #endif
15
+ #else
16
+ #define _WIN32_WINNT WINVER
17
+ #endif
11
18
#endif
12
19
#include < pybind11/pybind11.h>
13
20
#ifdef __linux__
@@ -125,7 +132,7 @@ static void
125
132
mpl_SetForegroundWindow (py::capsule UNUSED_ON_NON_WINDOWS (handle_p))
126
133
{
127
134
#ifdef _WIN32
128
- if (handle_p.name () != " HWND" ) {
135
+ if (strcmp ( handle_p.name (), " HWND" ) != 0 ) {
129
136
throw std::runtime_error (" Handle must be a value returned from Win32_GetForegroundWindow" );
130
137
}
131
138
HWND handle = static_cast <HWND>(handle_p.get_pointer ());
@@ -158,7 +165,7 @@ mpl_SetProcessDpiAwareness_max(void)
158
165
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE}; // Win10
159
166
if (IsValidDpiAwarenessContextPtr != NULL
160
167
&& SetProcessDpiAwarenessContextPtr != NULL ) {
161
- for (int i = 0 ; i < sizeof (ctxs) / sizeof (DPI_AWARENESS_CONTEXT); ++i) {
168
+ for (size_t i = 0 ; i < sizeof (ctxs) / sizeof (DPI_AWARENESS_CONTEXT); ++i) {
162
169
if (IsValidDpiAwarenessContextPtr (ctxs[i])) {
163
170
SetProcessDpiAwarenessContextPtr (ctxs[i]);
164
171
break ;
Original file line number Diff line number Diff line change 19
19
#define WIN32_LEAN_AND_MEAN
20
20
// Windows 8.1
21
21
#define WINVER 0x0603
22
- #define _WIN32_WINNT 0x0603
22
+ #if defined(_WIN32_WINNT)
23
+ #if _WIN32_WINNT < WINVER
24
+ #undef _WIN32_WINNT
25
+ #define _WIN32_WINNT WINVER
26
+ #endif
27
+ #else
28
+ #define _WIN32_WINNT WINVER
29
+ #endif
23
30
#endif
24
31
25
32
#include < pybind11/pybind11.h>
You can’t perform that action at this time.
0 commit comments