MINOR: compiler: always define __has_feature()

This macro is provided by clang but gcc lacks it. Not having it makes
it painful to test features on both compilers. Better define it to zero
when not available so that __has_feature(foo) never errors.
This commit is contained in:
Willy Tarreau 2020-06-16 19:13:24 +02:00
parent 88bd9ee6a3
commit 6d4c81db96

View File

@ -243,4 +243,12 @@
#define __decl_thread(decl)
#endif
/* clang has a __has_feature() macro which reports true/false on a number of
* internally supported features. Let's make sure this macro is always defined
* and returns zero when not supported.
*/
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#endif /* _HAPROXY_COMPILER_H */