summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorMax BĂ©langer <aeromax@gmail.com>2018-10-21 00:07:54 (GMT)
committerBenjamin Peterson <benjamin@python.org>2018-10-21 00:07:54 (GMT)
commit94451182ccd6729c11338926d8a3d11645e86626 (patch)
tree5b2445d676ee531a57303e7c09a3ab1d528019b8 /Modules/timemodule.c
parent12d0ff12305957511c9da22513858adbcef72a95 (diff)
downloadcpython-94451182ccd6729c11338926d8a3d11645e86626.zip
cpython-94451182ccd6729c11338926d8a3d11645e86626.tar.gz
cpython-94451182ccd6729c11338926d8a3d11645e86626.tar.bz2
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
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index f41d6fa..01eb9f6 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -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)