diff --git a/libcxx/include/limits.h b/libcxx/include/limits.h --- a/libcxx/include/limits.h +++ b/libcxx/include/limits.h @@ -43,13 +43,8 @@ # pragma GCC system_header #endif -#ifndef __GNUC__ +#ifdef _LIBCPP_COMPILER_GCC -# if __has_include_next() -# include_next -# endif - -#else // GCC header limits.h recursively includes itself through another header called // syslimits.h for some reason. This setup breaks down if we directly // #include_next GCC's limits.h (reasons not entirely clear to me). @@ -64,6 +59,13 @@ // Get the ISO C defines #undef _GCC_LIMITS_H_ #include_next -#endif // __GNUC__ + +#else + +# if __has_include_next() +# include_next +# endif + +#endif // _LIBCPP_COMPILER_GCC #endif // _LIBCPP_LIMITS_H