aboutsummaryrefslogtreecommitdiff
path: root/include/limits.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-16 01:04:19 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-16 01:04:19 +0000
commit389b70491b4d6ff078712b848600a36efcced323 (patch)
tree5d82f03dc85df96e8fa6eb2a21c9cdc6077886c2 /include/limits.h
parent70514a9f51d5b1185add6a4e99d9b5962cf19d16 (diff)
downloadglibc-389b70491b4d6ff078712b848600a36efcced323.zip
glibc-389b70491b4d6ff078712b848600a36efcced323.tar.gz
glibc-389b70491b4d6ff078712b848600a36efcced323.tar.bz2
Define LLONG_MIN, LLONG_MAX, ULLONG_MAX if necessary. Move includes of POSIX and Unix limits files to the end.
Diffstat (limited to 'include/limits.h')
-rw-r--r--include/limits.h41
1 files changed, 28 insertions, 13 deletions
diff --git a/include/limits.h b/include/limits.h
index 643c32d..d0c3d61 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -25,19 +25,6 @@
#include <features.h>
-#ifdef __USE_POSIX
-/* POSIX adds things to <limits.h>. */
-# include <bits/posix1_lim.h>
-#endif
-
-#ifdef __USE_POSIX2
-# include <bits/posix2_lim.h>
-#endif
-
-#ifdef __USE_XOPEN
-# include <bits/xopen_lim.h>
-#endif
-
/* Maximum length of any multibyte character in any locale.
We define this value here since the gcc header does not define
@@ -133,4 +120,32 @@
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
/* `_GCC_LIMITS_H_' is what GCC's file defines. */
# include_next <limits.h>
+
+/* The <limits.h> files in some gcc versions don't define LLONG_MIN,
+ LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
+ ages are available. */
+# ifdef __USE_ISOC99
+# ifndef LLONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+# endif
+# ifndef LLONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+# endif
+# ifndef ULLONG_MAX
+# define ULLONG_MAX ULONG_LONG_MAX
+# endif
+# endif
+#endif
+
+#ifdef __USE_POSIX
+/* POSIX adds things to <limits.h>. */
+# include <bits/posix1_lim.h>
+#endif
+
+#ifdef __USE_POSIX2
+# include <bits/posix2_lim.h>
+#endif
+
+#ifdef __USE_XOPEN
+# include <bits/xopen_lim.h>
#endif