https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Except that it doesn't work either, because even the __GLIBC__ and __GLIBC_MINOR__ macros are defined in glibc headers. --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -252,12 +252,15 @@ #undef y #endif -#ifdef __GLIBC_PREREQ -#if ! __GLIBC_PREREQ(2, 19) +#if defined (__linux__) || defined (__gnu_hurd__) +#if __has_include(<features.h>) +#include <features.h> +#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 19 // Glibc defines this prior to 2.19 #undef __unused #endif #endif +#endif #if __has_include(<newlib.h>) // newlib's <sys/cdefs.h> defines these as macros. seems to work. __GLIBC_PREREQ was introduced only 3 years after first glibc 2.x release.