[libcxx-commits] [PATCH] D138384: [libc++] Remove workaround for limits.h on GCC

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 20 10:57:43 PST 2022


ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This workaround does not appear to be necessary anymore with newer
versions of GCC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138384

Files:
  libcxx/include/limits.h


Index: libcxx/include/limits.h
===================================================================
--- libcxx/include/limits.h
+++ libcxx/include/limits.h
@@ -43,26 +43,8 @@
 #  pragma GCC system_header
 #endif
 
-#ifndef __GNUC__
-
-#  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). Therefore,
-// we manually re-create the necessary include sequence below:
-
-// Get the system limits.h defines (force recurse into the next level)
-#define _GCC_LIMITS_H_
-#define _GCC_NEXT_LIMITS_H
-#include_next <limits.h>
-
-// Get the ISO C defines
-#undef _GCC_LIMITS_H_
-#include_next <limits.h>
-#endif // __GNUC__
+#if __has_include_next(<limits.h>)
+#  include_next <limits.h>
+#endif
 
 #endif // _LIBCPP_LIMITS_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138384.476764.patch
Type: text/x-patch
Size: 968 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221120/5b00ecda/attachment.bin>


More information about the libcxx-commits mailing list