]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: compiler: add a default definition for __has_attribute()
authorWilly Tarreau <w@1wt.eu>
Sun, 13 Nov 2022 10:39:18 +0000 (11:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 10:14:02 +0000 (11:14 +0100)
commit2b080f713f61d19a91a1ef27ec0505c20739d508
tree3ae7fdf75a324e58be9ef1c74991f629e9cc4794
parent08e09f0b3c5803286fb1db13f56273a793a5826e
BUILD: compiler: add a default definition for __has_attribute()

It happens that gcc since 5.x has this macro which is only mentioned
once in the doc, associated with __builtin_has_attribute(). Clang had
it at least since 3.0. In addition it validates #ifdef when present,
so it's easy to detect it. Here we're providing a fallback to another
macro __has_attribute_<name> so that it's possible to define that macro
to the value 1 for older compilers when the attribute is supported.
include/haproxy/compiler.h