diff --git a/file.c b/file.c index 7bb858ae15..97172257c0 100644 --- a/file.c +++ b/file.c @@ -2930,7 +2930,7 @@ utime_failed(struct apply_arg *aa) # elif defined(__APPLE__) && \ (!defined(MAC_OS_X_VERSION_13_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13_0)) -# if defined(__has_attribute) && __has_attribute(availability) +# if __has_attribute(availability) && __has_warning("-Wunguarded-availability-new") typedef int utimensat_func(int, const char *, const struct timespec [2], int); RBIMPL_WARNING_PUSH() @@ -2945,7 +2945,7 @@ RBIMPL_WARNING_POP() # define utimensat rb_utimensat() # else /* __API_AVAILABLE macro does nothing on gcc */ __attribute__((weak)) int utimensat(int, const char *, const struct timespec [2], int); -# endif /* defined(__has_attribute) && __has_attribute(availability) */ +# endif /* utimesat availability */ # endif /* __APPLE__ && < MAC_OS_X_VERSION_13_0 */ static int