]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121199: Use _Py__has_attribute() in timemodule.c (#121203)
authorVictor Stinner <vstinner@python.org>
Mon, 1 Jul 2024 08:49:33 +0000 (10:49 +0200)
committerGitHub <noreply@github.com>
Mon, 1 Jul 2024 08:49:33 +0000 (08:49 +0000)
Use the _Py__has_attribute() macro in timemodule.c and
bootstrap_hash.c to fix a build error on old GCC versions (GCC 4.8.5
on s390x).

Modules/timemodule.c
Python/bootstrap_hash.c

index ed2d32688ecea5a84adb492e07eb8f123c9230a9..4b10730436c1aae2572668dd76ed527f1099aa67 100644 (file)
@@ -1488,7 +1488,7 @@ _PyTime_GetThreadTimeWithInfo(PyTime_t *tp, _Py_clock_info_t *info)
       !defined(__EMSCRIPTEN__) && !defined(__wasi__)
 #define HAVE_THREAD_TIME
 
-#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
+#if defined(__APPLE__) && _Py__has_attribute(availability)
 static int
 _PyTime_GetThreadTimeWithInfo(PyTime_t *tp, _Py_clock_info_t *info)
      __attribute__((availability(macos, introduced=10.12)))
index 92f2301a012c0af59bb404e02a5cd2f9a5132328..1dc5bffe1b000351da11d1f124b91bd89ce5d949 100644 (file)
@@ -199,7 +199,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise)
 
    getentropy() is retried if it failed with EINTR: interrupted by a signal. */
 
-#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
+#if defined(__APPLE__) && _Py__has_attribute(availability)
 static int
 py_getentropy(char *buffer, Py_ssize_t size, int raise)
         __attribute__((availability(macos,introduced=10.12)))