aboutsummaryrefslogtreecommitdiff
path: root/gnulib/import/limits.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/import/limits.in.h')
-rw-r--r--gnulib/import/limits.in.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/gnulib/import/limits.in.h b/gnulib/import/limits.in.h
index 90c273f..d25c523 100644
--- a/gnulib/import/limits.in.h
+++ b/gnulib/import/limits.in.h
@@ -15,16 +15,32 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <https://www.gnu.org/licenses/>. */
-#ifndef _@GUARD_PREFIX@_LIMITS_H
-
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
-/* The include_next requires a split double-inclusion guard. */
+#if defined _GL_ALREADY_INCLUDING_LIMITS_H
+/* Special invocation convention:
+ On Haiku/x86_64, we have a sequence of nested includes
+ <limits.h> -> <syslimits.h> -> <limits.h>.
+ In this situation, LONG_MAX and INT_MAX are not yet defined,
+ therefore we should not attempt to define LONG_BIT. */
+
#@INCLUDE_NEXT@ @NEXT_LIMITS_H@
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+
+# define _GL_ALREADY_INCLUDING_LIMITS_H
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+# undef _GL_ALREADY_INCLUDING_LIMITS_H
+
#ifndef _@GUARD_PREFIX@_LIMITS_H
#define _@GUARD_PREFIX@_LIMITS_H
@@ -102,3 +118,4 @@
#endif /* _@GUARD_PREFIX@_LIMITS_H */
#endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif