MINGW-packages/mingw-w64-python3.13/0134-Mimic-MSVC-for-timezone-optimized-memcpy-for-hash-ma.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

61 lines
2.0 KiB
Diff

From 75a15a33501faea64edcf728da86a7e72349a7a6 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Mon, 1 Sep 2025 13:26:35 +0300
Subject: [PATCH 134/N] Mimic MSVC for timezone, optimized memcpy for hash,
math
---
Modules/mathmodule.c | 4 ++--
Modules/timemodule.c | 2 +-
Python/pyhash.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index aee1b17..08783f3 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -2166,7 +2166,7 @@ math_ldexp_impl(PyObject *module, double x, PyObject *i)
} else {
errno = 0;
r = ldexp(x, (int)exp);
-#ifdef _MSC_VER
+#ifdef _WIN32
if (DBL_MIN > r && r > -DBL_MIN) {
/* Denormal (or zero) results can be incorrectly rounded here (rather,
truncated). Fixed in newer versions of the C runtime, included
@@ -2404,7 +2404,7 @@ math_fmod_impl(PyObject *module, double x, double y)
return PyFloat_FromDouble(x);
errno = 0;
r = fmod(x, y);
-#ifdef _MSC_VER
+#ifdef _WIN32
/* Windows (e.g. Windows 10 with MSC v.1916) loose sign
for zero result. But C99+ says: "if y is nonzero, the result
has the same sign as x".
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index c77fe7c..261d7bf 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -41,7 +41,7 @@
# include <sanitizer/msan_interface.h>
#endif
-#ifdef _MSC_VER
+#ifdef _WIN32
# define _Py_timezone _timezone
# define _Py_daylight _daylight
# define _Py_tzname _tzname
diff --git a/Python/pyhash.c b/Python/pyhash.c
index 5263622..ccf5258 100644
--- a/Python/pyhash.c
+++ b/Python/pyhash.c
@@ -215,7 +215,7 @@ PyHash_GetFuncDef(void)
}
/* Optimized memcpy() for Windows */
-#ifdef _MSC_VER
+#ifdef _WIN32
# if SIZEOF_PY_UHASH_T == 4
# define PY_UHASH_CPY(dst, src) do { \
dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; \