Skip to content

Commit 9445118

Browse files
maxbelangerbenjaminp
authored andcommitted
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
1 parent 12d0ff1 commit 9445118

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule``
2+
on macOS.

Modules/timemodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,8 @@ PyInit_time(void)
17231723
/* Set, or reset, module variables like time.timezone */
17241724
PyInit_timezone(m);
17251725

1726+
#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES)
1727+
17261728
#ifdef CLOCK_REALTIME
17271729
PyModule_AddIntMacro(m, CLOCK_REALTIME);
17281730
#endif
@@ -1751,6 +1753,8 @@ PyInit_time(void)
17511753
PyModule_AddIntMacro(m, CLOCK_UPTIME);
17521754
#endif
17531755

1756+
#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */
1757+
17541758
if (!initialized) {
17551759
if (PyStructSequence_InitType2(&StructTimeType,
17561760
&struct_time_type_desc) < 0)

0 commit comments

Comments
 (0)