Next: __has_include
, Previous: __has_feature
, Up: Conditional Syntax [Contents][Index]
__has_extension
The special operator __has_extension (operand)
may be used in constant integer contexts and in preprocessor #if and #elif expressions to test whether the identifier given in operand is recognized as an extension supported by GCC given the current options. In any given context, the features accepted by __has_extension
are a strict superset of those accepted by __has_feature
. Unlike __has_feature
, __has_extension
tests whether a given feature is available regardless of strict language standards conformance.
If the -pedantic-errors flag is given, __has_extension
is equivalent to __has_feature
.
Note that __has_feature
and __has_extension
are not recommended for use in new code, and are only provided for compatibility with Clang. For details of which identifiers are accepted by these function-like macros, see the Clang documentation.