@@ -38,6 +38,16 @@
|
38 | 38 | # include <sanitizer/msan_interface.h> |
39 | 39 | #endif |
40 | 40 | |
| 41 | +#ifdef _MSC_VER |
| 42 | +#define _Py_timezone _timezone |
| 43 | +#define _Py_daylight _daylight |
| 44 | +#define _Py_tzname _tzname |
| 45 | +#else |
| 46 | +#define _Py_timezone timezone |
| 47 | +#define _Py_daylight daylight |
| 48 | +#define _Py_tzname tzname |
| 49 | +#endif |
| 50 | + |
41 | 51 | #define SEC_TO_NS (1000 * 1000 * 1000) |
42 | 52 | |
43 | 53 | /* Forward declarations */ |
@@ -1600,18 +1610,18 @@ init_timezone(PyObject *m)
|
1600 | 1610 | #ifdef HAVE_DECL_TZNAME |
1601 | 1611 | PyObject *otz0, *otz1; |
1602 | 1612 | tzset(); |
1603 | | -PyModule_AddIntConstant(m, "timezone", timezone); |
| 1613 | +PyModule_AddIntConstant(m, "timezone", _Py_timezone); |
1604 | 1614 | #ifdef HAVE_ALTZONE |
1605 | 1615 | PyModule_AddIntConstant(m, "altzone", altzone); |
1606 | 1616 | #else |
1607 | | -PyModule_AddIntConstant(m, "altzone", timezone-3600); |
| 1617 | +PyModule_AddIntConstant(m, "altzone", _Py_timezone-3600); |
1608 | 1618 | #endif |
1609 | | -PyModule_AddIntConstant(m, "daylight", daylight); |
1610 | | -otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape"); |
| 1619 | +PyModule_AddIntConstant(m, "daylight", _Py_daylight); |
| 1620 | +otz0 = PyUnicode_DecodeLocale(_Py_tzname[0], "surrogateescape"); |
1611 | 1621 | if (otz0 == NULL) { |
1612 | 1622 | return -1; |
1613 | 1623 | } |
1614 | | -otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape"); |
| 1624 | +otz1 = PyUnicode_DecodeLocale(_Py_tzname[1], "surrogateescape"); |
1615 | 1625 | if (otz1 == NULL) { |
1616 | 1626 | Py_DECREF(otz0); |
1617 | 1627 | return -1; |
|