[libcxx-commits] [PATCH] D138438: [libc++] Don't workaround GCC issue on non-GCC compilers

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 21 10:41:25 PST 2022


ldionne updated this revision to Diff 476947.
ldionne added a comment.

Trigger CI


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138438/new/

https://reviews.llvm.org/D138438

Files:
  libcxx/include/limits.h


Index: libcxx/include/limits.h
===================================================================
--- libcxx/include/limits.h
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138438.476947.patch
Type: text/x-patch
Size: 838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221121/bddbd074/attachment.bin>


More information about the libcxx-commits mailing list