[libcxx-commits] [libcxx] 4548fca - [libc++] Don't workaround GCC issue on non-GCC compilers

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 21 13:09:04 PST 2022


Author: Louis Dionne
Date: 2022-11-21T16:08:50-05:00
New Revision: 4548fca74272c58e2c5c44d4eb9c5bb4ae3e4d16

URL: https://github.com/llvm/llvm-project/commit/4548fca74272c58e2c5c44d4eb9c5bb4ae3e4d16
DIFF: https://github.com/llvm/llvm-project/commit/4548fca74272c58e2c5c44d4eb9c5bb4ae3e4d16.diff

LOG: [libc++] Don't workaround GCC issue on non-GCC compilers

Differential Revision: https://reviews.llvm.org/D138438

Added: 
    

Modified: 
    libcxx/include/limits.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/limits.h b/libcxx/include/limits.h
index 570e213f03df..537a4b1439f9 100644
--- 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(<limits.h>)
-#    include_next <limits.h>
-#  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 <limits.h>
-#endif // __GNUC__
+
+#else
+
+#  if __has_include_next(<limits.h>)
+#    include_next <limits.h>
+#  endif
+
+#endif // _LIBCPP_COMPILER_GCC
 
 #endif // _LIBCPP_LIMITS_H


        


More information about the libcxx-commits mailing list