summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/gsyslimits.h2
-rw-r--r--gcc/limitx.h4
-rw-r--r--gcc/limity.h6
3 files changed, 10 insertions, 2 deletions
diff --git a/gcc/gsyslimits.h b/gcc/gsyslimits.h
index 0a91639d7d2..a3628025e8a 100644
--- a/gcc/gsyslimits.h
+++ b/gcc/gsyslimits.h
@@ -3,4 +3,6 @@
If fixincludes fixes it, then the fixed version is installed
instead of this text. */
+#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
#include_next <limits.h>
+#undef _GCC_NEXT_LIMITS_H
diff --git a/gcc/limitx.h b/gcc/limitx.h
index 4e383bcb1f0..529d9c5f9cf 100644
--- a/gcc/limitx.h
+++ b/gcc/limitx.h
@@ -7,6 +7,6 @@
#define _GCC_LIMITS_H_
#ifndef _LIBC_LIMITS_H_
-/* Use <...> so that we find syslimits.h only in system include dirs. */
-#include <syslimits.h>
+/* Use "..." so that we find syslimits.h only in this same directory. */
+#include "syslimits.h"
#endif
diff --git a/gcc/limity.h b/gcc/limity.h
index 5492553c9c5..8bb398f6786 100644
--- a/gcc/limity.h
+++ b/gcc/limity.h
@@ -1,4 +1,10 @@
/* This administrivia gets added to the end of limits.h
if the system has its own version of limits.h. */
+#else /* not _GCC_LIMITS_H_ */
+
+#ifdef _GCC_NEXT_LIMITS_H
+#include_next <limits.h> /* recurse down to the real one */
+#endif
+
#endif /* not _GCC_LIMITS_H_ */