This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I'd suggest defining exactly one new preprocessor symbol, to advertise the support for the feature-testing mechanism. For instance, __HAVE_EXTENSION_SUPPORTED__, or __FEATURE_SUPPORTED_SUPPORTED__. :) The rest could use syntax like you suggest above. For instance:
#ifndef __FEATURE_SUPPORTED_SUPPORTED__ /* or whatever :) */ #define has_extension(x) 0 #else #define has_extension(x) __has_extension__(x) #endif
#ifdef __has_extension__ ...
The only problem then becomes maintaining the canonical list of
extension names. We could use the ugly approach of names like
"org.gnu.gcc.extension.sentinel" and "org.kernel.sparse.address_space",
but that seems entirely too ugly. The other alternative seems like a
central registry of extension names; I'd happily help maintain such a
registry.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |