Skip to content

Commit a0b8b34

Browse files
authored
gh-121199: Use _Py__has_attribute() in timemodule.c (#121203)
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).
1 parent af8c3d7 commit a0b8b34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ _PyTime_GetThreadTimeWithInfo(PyTime_t *tp, _Py_clock_info_t *info)
14881488
!defined(__EMSCRIPTEN__) && !defined(__wasi__)
14891489
#define HAVE_THREAD_TIME
14901490

1491-
#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
1491+
#if defined(__APPLE__) && _Py__has_attribute(availability)
14921492
static int
14931493
_PyTime_GetThreadTimeWithInfo(PyTime_t *tp, _Py_clock_info_t *info)
14941494
__attribute__((availability(macos, introduced=10.12)))

Python/bootstrap_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise)
199199
200200
getentropy() is retried if it failed with EINTR: interrupted by a signal. */
201201

202-
#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
202+
#if defined(__APPLE__) && _Py__has_attribute(availability)
203203
static int
204204
py_getentropy(char *buffer, Py_ssize_t size, int raise)
205205
__attribute__((availability(macos,introduced=10.12)))

0 commit comments

Comments
 (0)