Skip to content

Commit d11d615

Browse files
committed
Fix utimesat availability condition
As `__has_attribute` macro is always defined in internal/compilers.h, gcc warns `-Wunguarded-availability-new` as unknown option. Check if the warning option is usable instead.
1 parent d0c17cb commit d11d615

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@ utime_failed(struct apply_arg *aa)
29302930
# elif defined(__APPLE__) && \
29312931
(!defined(MAC_OS_X_VERSION_13_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13_0))
29322932

2933-
# if defined(__has_attribute) && __has_attribute(availability)
2933+
# if __has_attribute(availability) && __has_warning("-Wunguarded-availability-new")
29342934
typedef int utimensat_func(int, const char *, const struct timespec [2], int);
29352935

29362936
RBIMPL_WARNING_PUSH()
@@ -2945,7 +2945,7 @@ RBIMPL_WARNING_POP()
29452945
# define utimensat rb_utimensat()
29462946
# else /* __API_AVAILABLE macro does nothing on gcc */
29472947
__attribute__((weak)) int utimensat(int, const char *, const struct timespec [2], int);
2948-
# endif /* defined(__has_attribute) && __has_attribute(availability) */
2948+
# endif /* utimesat availability */
29492949
# endif /* __APPLE__ && < MAC_OS_X_VERSION_13_0 */
29502950

29512951
static int

0 commit comments

Comments
 (0)