From ff3b574b05fd98b1359bab829a3b4a510a068fb1 Mon Sep 17 00:00:00 2001 From: Max Belanger Date: Thu, 18 Oct 2018 23:39:02 -0700 Subject: [PATCH 1/3] bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions --- Modules/timemodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/timemodule.c b/Modules/timemodule.c index f41d6fab95ba4b..01eb9f69c4a729 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) From fa70597c6f76a3b2786b93d0a1855f82bc8f435c Mon Sep 17 00:00:00 2001 From: Max Belanger Date: Thu, 18 Oct 2018 23:55:03 -0700 Subject: [PATCH 2/3] add blurb --- Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst diff --git a/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst new file mode 100644 index 00000000000000..1c32aca138e0b6 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst @@ -0,0 +1,2 @@ +Properly guard the use of the `CLOCK_GETTIME` et al. macros in `timemodule` +on macOS. From 66f75499e26cfbfab3540e4607705b99314c20a1 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 20 Oct 2018 16:29:12 -0700 Subject: [PATCH 3/3] fix reST --- Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst index 1c32aca138e0b6..aebd1af9351c11 100644 --- a/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst +++ b/Misc/NEWS.d/next/macOS/2018-10-18-23-54-55.bpo-35025.X4LFJg.rst @@ -1,2 +1,2 @@ -Properly guard the use of the `CLOCK_GETTIME` et al. macros in `timemodule` +Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule`` on macOS.