Kaydet (Commit) 94451182 authored tarafından Max Bélanger's avatar Max Bélanger Kaydeden (comit) Benjamin Peterson

closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in timemodule.c. (GH-9961)

Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions
üst 12d0ff12
Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule``
on macOS.
......@@ -1723,6 +1723,8 @@ PyInit_time(void)
/* Set, or reset, module variables like time.timezone */
PyInit_timezone(m);
#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES)
#ifdef CLOCK_REALTIME
PyModule_AddIntMacro(m, CLOCK_REALTIME);
#endif
......@@ -1751,6 +1753,8 @@ PyInit_time(void)
PyModule_AddIntMacro(m, CLOCK_UPTIME);
#endif
#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */
if (!initialized) {
if (PyStructSequence_InitType2(&StructTimeType,
&struct_time_type_desc) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment