mirror of https://github.com/python/cpython
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
This commit is contained in:
parent
12d0ff1230
commit
94451182cc
|
@ -0,0 +1,2 @@
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue