]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Get rid of duplicate definition of __has_attribute.
authorGuy Harris <[email protected]>
Wed, 11 Aug 2021 08:44:51 +0000 (01:44 -0700)
committerGuy Harris <[email protected]>
Wed, 11 Aug 2021 08:44:51 +0000 (01:44 -0700)
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.

funcattrs.h

index 129492e568084dc695ff78feb8cafde765efc42d..17afdda25106e2292ff58112d37075d3711d1354 100644 (file)
  * 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.