From 289fad11d21b6dfc9687abd04726030342669453 Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Mon, 24 Jun 2024 23:06:19 +0300 Subject: [PATCH] Fix attribute handling - Add a __has_attribute(x) pre-defined macro. Its value is 1 to minimize compile-time errors that might occur if an attribute is not supported. - Remove __attribute__(x) macro definitions, as this is internally supported. --- include/template/gcc-defs.h | 2 +- src/defs.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/template/gcc-defs.h b/include/template/gcc-defs.h index d272622d..1173aa82 100644 --- a/include/template/gcc-defs.h +++ b/include/template/gcc-defs.h @@ -35,7 +35,6 @@ #define __atomic_fetch_sub(x,y) (*(x)-=(y)) #define __atomic_fetch_sub_explicit(x,y,z) (*(x)-=(y)) #define __atomic_thread_fence(x) -#define __attribute__(x) #define __auto_type auto #define __builtin_add_overflow(x,y,z) ((x), (y), (z), 1) #define __builtin_add_overflow_p(x,y,z) ((x), (y), 1) @@ -154,6 +153,7 @@ #define __COUNTER__ 0 #define __extension #pragma define_immutable __extension__ +#define __has_attribute(x) 1 #define __int128 long #define __int128_t long #define __uint128_t long diff --git a/src/defs.h b/src/defs.h index 991fcd67..0df520bd 100644 --- a/src/defs.h +++ b/src/defs.h @@ -52,7 +52,6 @@ #endif #define __extension__ -#define __attribute__(x) #define __const const #define __builtin_va_list void * #define __builtin_stdarg_start