Skip to content

Commit 4548fca

Browse files
committed
[libc++] Don't workaround GCC issue on non-GCC compilers
Differential Revision: https://reviews.llvm.org/D138438
1 parent 699a59a commit 4548fca

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

libcxx/include/limits.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,8 @@
4343
# pragma GCC system_header
4444
#endif
4545

46-
#ifndef __GNUC__
46+
#ifdef _LIBCPP_COMPILER_GCC
4747

48-
# if __has_include_next(<limits.h>)
49-
# include_next <limits.h>
50-
# endif
51-
52-
#else
5348
// GCC header limits.h recursively includes itself through another header called
5449
// syslimits.h for some reason. This setup breaks down if we directly
5550
// #include_next GCC's limits.h (reasons not entirely clear to me).
@@ -64,6 +59,13 @@
6459
// Get the ISO C defines
6560
#undef _GCC_LIMITS_H_
6661
#include_next <limits.h>
67-
#endif // __GNUC__
62+
63+
#else
64+
65+
# if __has_include_next(<limits.h>)
66+
# include_next <limits.h>
67+
# endif
68+
69+
#endif // _LIBCPP_COMPILER_GCC
6870

6971
#endif // _LIBCPP_LIMITS_H

0 commit comments

Comments
 (0)