Unverified Kaydet (Commit) 002aef3f authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) GitHub

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
(cherry picked from commit 94451182)
Co-authored-by: 's avatarMax Bélanger <aeromax@gmail.com>
üst f141ddaa
Properly guard the use of the ``CLOCK_GETTIME`` et al. macros in ``timemodule``
on macOS.
......@@ -1700,6 +1700,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
......@@ -1728,6 +1730,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