MINGW-packages/mingw-w64-python3.13/0131-Fix-pragma-warnings.patch
Christoph Reiter 04c9ed3700 python3.13: Add 3.13.7
* add libb2 as dep
* remove "-Wl,--large-address-aware", default now via makepkg
* remove 2to3 logic, no longer in Python
2025-09-08 22:02:30 +02:00

59 lines
1.5 KiB
Diff

From 2be224aecebe67ce690caaf5ef58addc0122e48b Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Mon, 1 Sep 2025 13:23:23 +0300
Subject: [PATCH 131/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 6b2275a..e14a1df 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 3d3985c..48b46da 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1710,8 +1710,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
@@ -1805,7 +1807,9 @@ error:
return NULL;
}
+#ifdef _MSC_VER
#pragma warning(pop)
+#endif
/*[clinic input]
sys._enablelegacywindowsfsencoding