Files
MINGW-packages/mingw-w64-python/0083-Fix-pragma-warnings.patch
2026-01-07 22:17:09 +01:00

59 lines
1.5 KiB
Diff

From 49e142ce98f7a92fc2629442d27caf6369b4a36c Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Mon, 1 Sep 2025 13:23:23 +0300
Subject: [PATCH 083/N] Fix pragma warnings
---
Modules/_winapi.c | 4 ++++
Python/sysmodule.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index 8d29c46..edcaae7 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -1713,14 +1713,18 @@ _winapi_GetVersion_impl(PyObject *module)
/* Disable deprecation warnings about GetVersionEx as the result is
being passed straight through to the caller, who is responsible for
using it correctly. */
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
+#endif
{
return GetVersion();
}
+#ifdef _MSC_VER
#pragma warning(pop)
+#endif
/*[clinic input]
_winapi.MapViewOfFile -> LPVOID
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 5b62b52..b3d6e58 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1745,8 +1745,10 @@ _sys_getwindowsversion_from_kernel32(void)
/* Disable deprecation warnings about GetVersionEx as the result is
being passed straight through to the caller, who is responsible for
using it correctly. */
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
+#endif
/*[clinic input]
sys.getwindowsversion
@@ -1840,7 +1842,9 @@ error:
return NULL;
}
+#ifdef _MSC_VER
#pragma warning(pop)
+#endif
/*[clinic input]
sys._enablelegacywindowsfsencoding