diff --git a/lib/auxlib.h b/lib/auxlib.h index 7610fac9f..e03439236 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -448,7 +448,7 @@ INLINE pid_t gettid(void) { /*** TAINT FUNCTIONS ***/ -#if __has_attribute(__error__) +#if HAS_ATTR(__error__) /* This is not supported in clang, and on gcc it might become inert if the * symbol gets remapped to a builtin or stack protected function, but it * otherwise gives better diagnostics. */ diff --git a/lib/compat.h b/lib/compat.h index 6bcd61e1a..d39078f32 100644 --- a/lib/compat.h +++ b/lib/compat.h @@ -7,12 +7,16 @@ # define INLINE static inline __attribute__((always_inline)) #endif -#define ACCESS(...) #if defined __has_attribute -# if __has_attribute(access) -# undef ACCESS -# define ACCESS(...) __attribute__((access(__VA_ARGS__))) -# endif +# define HAS_ATTR(x) __has_attribute(x) +#else +# define HAS_ATTR(x) 0 +#endif + +#if HAS_ATTR(access) +# define ACCESS(...) __attribute__((access(__VA_ARGS__))) +#else +# define ACCESS(...) #endif