1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

sys/cdefs.h: Note gcc supports many __has_* macros

The __has_* macros are no longer clang-speicifc. gcc 5 introduced
__has_include, gcc 9 introduce __has_attribute, gcc 10 introduced
__has_builtin. So all of these are supported by all the versrions of gcc
we support as a project (we have gcc 10 and newer ports, but no older
ones), so just refer to them as supported by gcc. The exact version
doesn't matter so much these days (we provide a fallback for older
compilers still, should anybody still be using them), so don't mention
them in the comments (but here in the commit message they are
discoverable).

gcc 14 adds __has_feature and __has_extension, so note that since it
will be relevant for many years.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2024-06-24 13:20:57 -06:00
parent 65522b64ad
commit 677b28750a

View File

@ -40,7 +40,10 @@
#endif
/*
* Testing against Clang-specific extensions.
* Provide clang-compatible testing macros. All supported versions of gcc (10+)
* provide all of these except has_feature and has_extension which are new in
* gcc 14. Keep the older ifndefs, though, for non-gcc compilers that may lack
* them like tcc and pcc.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0