On Wed, Apr 25, 2012 at 23:05, James K. Lowden <jklowden@xxxxxxxxxxxxxxx> wrote: > I would like to be able to test whether or not the preprocessor > supports the visibility pragma. My program today says: > > #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__MINGW32__) > #pragma GCC visibility push(hidden) > #endif > > which cries out for a feature test > > #if HAVE_PRAGMA_VISIBILITY > #pragma GCC visibility push(hidden) > #endif > > because e.g. clang defines GCC. Ok, but what if compiler does not support "#pragma GCC visibility", what you plan to do? The reason of question: if samples above are full, i.e. you indeed don't have #else part, then you just don't need the #if at all. If compiler supports "#pragma GCC visibility" then it will execute it with #if (because HAVE_PRAGMA_VISIBILITY will be defined) or without. If compiler doesn't support it, then pragma GCC visibility will be skipped with #if (because undefined HAVE_PRAGMA_VISIBILITY) or without (just because unknown pragmas are ignored per standard). -- Andrew W. Nosenko <andrew.w.nosenko@xxxxxxxxx> _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx https://lists.gnu.org/mailman/listinfo/autoconf