Skip to content

Commit

Permalink
pythongh-121199: Use _Py__has_attribute() in timemodule.c (python#121203
Browse files Browse the repository at this point in the history
)

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).
  • Loading branch information
vstinner authored Jul 1, 2024
1 parent af8c3d7 commit a0b8b34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
2 changes: 1 addition & 1 deletion Python/bootstrap_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit a0b8b34

Please sign in to comment.