Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8a8fe61

Browse filesBrowse files
authored
Merge pull request #28686 from meeseeksmachine/auto-backport-of-pr-28682-on-v3.9.x
Backport PR #28682 on branch v3.9.x (Fix warnings from mingw compilers)
2 parents 2811043 + c57960c commit 8a8fe61
Copy full SHA for 8a8fe61

File tree

2 files changed

+18
-4
lines changed
Filter options

2 files changed

+18
-4
lines changed

‎src/_c_internal_utils.cpp

Copy file name to clipboardExpand all lines: src/_c_internal_utils.cpp
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
#define WIN32_LEAN_AND_MEAN
88
// Windows 10, for latest HiDPI API support.
99
#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
1118
#endif
1219
#include <pybind11/pybind11.h>
1320
#ifdef __linux__
@@ -125,7 +132,7 @@ static void
125132
mpl_SetForegroundWindow(py::capsule UNUSED_ON_NON_WINDOWS(handle_p))
126133
{
127134
#ifdef _WIN32
128-
if (handle_p.name() != "HWND") {
135+
if (strcmp(handle_p.name(), "HWND") != 0) {
129136
throw std::runtime_error("Handle must be a value returned from Win32_GetForegroundWindow");
130137
}
131138
HWND handle = static_cast<HWND>(handle_p.get_pointer());
@@ -158,7 +165,7 @@ mpl_SetProcessDpiAwareness_max(void)
158165
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE}; // Win10
159166
if (IsValidDpiAwarenessContextPtr != NULL
160167
&& 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) {
162169
if (IsValidDpiAwarenessContextPtr(ctxs[i])) {
163170
SetProcessDpiAwarenessContextPtr(ctxs[i]);
164171
break;

‎src/_tkagg.cpp

Copy file name to clipboardExpand all lines: src/_tkagg.cpp
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@
1919
#define WIN32_LEAN_AND_MEAN
2020
// Windows 8.1
2121
#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
2330
#endif
2431

2532
#include <pybind11/pybind11.h>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.