From 9bb3b566fda6adc4044c939134121f83aaec0699 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Mon, 26 May 2025 22:20:34 -0700 Subject: [PATCH] gh-134771: Fix time_clockid_converter() on Cygwin. Use long for clockid_t instead of int. --- .../next/Library/2025-05-26-22-18-32.gh-issue-134771.RKXpLT.rst | 2 ++ Modules/timemodule.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2025-05-26-22-18-32.gh-issue-134771.RKXpLT.rst diff --git a/Misc/NEWS.d/next/Library/2025-05-26-22-18-32.gh-issue-134771.RKXpLT.rst b/Misc/NEWS.d/next/Library/2025-05-26-22-18-32.gh-issue-134771.RKXpLT.rst new file mode 100644 index 00000000000000..4b70c6ef398793 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-05-26-22-18-32.gh-issue-134771.RKXpLT.rst @@ -0,0 +1,2 @@ +The ``time_clockid_converter()`` function now selects correct type for +``clockid_t`` on Cygwin which fixes a build error. diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 1bfbf3f6a0b991..3271d87ddc27f2 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -187,7 +187,7 @@ time_clockid_converter(PyObject *obj, clockid_t *p) { #ifdef _AIX long long clk_id = PyLong_AsLongLong(obj); -#elif defined(__DragonFly__) +#elif defined(__DragonFly__) || defined(__CYGWIN__) long clk_id = PyLong_AsLong(obj); #else int clk_id = PyLong_AsInt(obj);