From 2be224aecebe67ce690caaf5ef58addc0122e48b Mon Sep 17 00:00:00 2001 From: Alexey Pavlov 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