Skip to content

Commit 75a15a3

Browse files
committed
Mimic MSVC for timezone, optimized memcpy for hash, math
1 parent c9c3270 commit 75a15a3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Modules/mathmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ math_ldexp_impl(PyObject *module, double x, PyObject *i)
21662166
} else {
21672167
errno = 0;
21682168
r = ldexp(x, (int)exp);
2169-
#ifdef _MSC_VER
2169+
#ifdef _WIN32
21702170
if (DBL_MIN > r && r > -DBL_MIN) {
21712171
/* Denormal (or zero) results can be incorrectly rounded here (rather,
21722172
truncated). Fixed in newer versions of the C runtime, included
@@ -2404,7 +2404,7 @@ math_fmod_impl(PyObject *module, double x, double y)
24042404
return PyFloat_FromDouble(x);
24052405
errno = 0;
24062406
r = fmod(x, y);
2407-
#ifdef _MSC_VER
2407+
#ifdef _WIN32
24082408
/* Windows (e.g. Windows 10 with MSC v.1916) loose sign
24092409
for zero result. But C99+ says: "if y is nonzero, the result
24102410
has the same sign as x".

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# include <sanitizer/msan_interface.h>
4242
#endif
4343

44-
#ifdef _MSC_VER
44+
#ifdef _WIN32
4545
# define _Py_timezone _timezone
4646
# define _Py_daylight _daylight
4747
# define _Py_tzname _tzname

Python/pyhash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ PyHash_GetFuncDef(void)
215215
}
216216

217217
/* Optimized memcpy() for Windows */
218-
#ifdef _MSC_VER
218+
#ifdef _WIN32
219219
# if SIZEOF_PY_UHASH_T == 4
220220
# define PY_UHASH_CPY(dst, src) do { \
221221
dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; \

0 commit comments

Comments
 (0)