зеркало из https://github.com/github/ruby.git
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.
This commit is contained in:
Родитель
d0c17cbd09
Коммит
d11d615ba6
4
file.c
4
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче