]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-134771: Fix time_clockid_converter() on Cygwin (#134772)
authorCollin Funk <collin.funk1@gmail.com>
Thu, 29 May 2025 17:35:53 +0000 (10:35 -0700)
committerGitHub <noreply@github.com>
Thu, 29 May 2025 17:35:53 +0000 (19:35 +0200)
Use long for clockid_t instead of int.

Misc/NEWS.d/next/Library/2025-05-26-22-18-32.gh-issue-134771.RKXpLT.rst [new file with mode: 0644]
Modules/timemodule.c

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 (file)
index 0000000..4b70c6e
--- /dev/null
@@ -0,0 +1,2 @@
+The ``time_clockid_converter()`` function now selects correct type for
+``clockid_t`` on Cygwin which fixes a build error.
index 1bfbf3f6a0b991ef7d46ce1b268cd2c576183df1..3271d87ddc27f2b3914b0127b440e45f8aad96f0 100644 (file)
@@ -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);