From: Guy Harris Date: Wed, 11 Aug 2021 08:44:51 +0000 (-0700) Subject: Get rid of duplicate definition of __has_attribute. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/bc4a4543f881fb972251248c9159c9a135c6b512 Get rid of duplicate definition of __has_attribute. compiler-tests.h already checks whether __has_attribute and, if not, defines it as a macro that always returns 0 (so that we use the "what version of the compiler is this?" fallback checks for a given attribute). We include compiler-tests.h before we define __has_attribute ourselves, so we don't need to do it ourselves. --- diff --git a/funcattrs.h b/funcattrs.h index 129492e5..17afdda2 100644 --- a/funcattrs.h +++ b/funcattrs.h @@ -42,24 +42,6 @@ * compiler-specific extensions. */ -/* - * This was introduced by Clang: - * - * https://clang.llvm.org/docs/LanguageExtensions.html#has-attribute - * - * in some version (which version?); it has been picked up by GCC 5.0. - */ -#ifndef __has_attribute - /* - * It's a macro, so you can check whether it's defined to check - * whether it's supported. - * - * If it's not, define it to always return 0, so that we move on to - * the fallback checks. - */ - #define __has_attribute(x) 0 -#endif - /* * NORETURN, before a function declaration, means "this function * never returns". (It must go before the function declaration, e.g.