1 /* This administrivia gets added to the beginning of limits.h
2 if the system has its own version of limits.h. */
4 /* We use _GCC_LIMITS_H_ because we want this not to match
5 any macros that the system's limits.h uses for its own purposes. */
6 #ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
9 #ifndef _LIBC_LIMITS_H_
10 /* Use "..." so that we find syslimits.h only in this same directory. */
11 #include "syslimits.h"
14 #ifndef _MACH_MACHLIMITS_H_
16 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
18 #define _MACH_MACHLIMITS_H_
20 /* Number of bits in a `char'. */
24 /* Maximum length of a multibyte character. */
29 /* Minimum and maximum values a `signed char' can hold. */
31 #define SCHAR_MIN (-128)
35 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
39 /* Minimum and maximum values a `char' can hold. */
40 #ifdef __CHAR_UNSIGNED__
47 #define CHAR_MIN (-128)
52 /* Minimum and maximum values a `signed short int' can hold. */
54 /* For the sake of 16 bit hosts, we may not use -32768 */
55 #define SHRT_MIN (-32767-1)
57 #define SHRT_MAX 32767
59 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
61 #define USHRT_MAX 65535
63 /* Minimum and maximum values a `signed int' can hold. */
65 #define __INT_MAX__ 2147483647
68 #define INT_MIN (-INT_MAX-1)
70 #define INT_MAX __INT_MAX__
72 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
74 #define UINT_MAX (INT_MAX * 2U + 1)
76 /* Minimum and maximum values a `signed long int' can hold.
79 #if defined (__alpha__) || (defined (_ARCH_PPC) && defined (__64BIT__)) || defined (__sparc_v9__) || defined (__sparcv9)
80 #define __LONG_MAX__ 9223372036854775807L
82 #define __LONG_MAX__ 2147483647L
83 #endif /* __alpha__ || sparc64 */
86 #define LONG_MIN (-LONG_MAX-1)
88 #define LONG_MAX __LONG_MAX__
90 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
92 #define ULONG_MAX (LONG_MAX * 2UL + 1)
94 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
95 /* Minimum and maximum values a `signed long long int' can hold. */
96 #ifndef __LONG_LONG_MAX__
97 #define __LONG_LONG_MAX__ 9223372036854775807LL
100 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
102 #define LONG_LONG_MAX __LONG_LONG_MAX__
104 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
105 #undef ULONG_LONG_MAX
106 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
109 #endif /* _MACH_MACHLIMITS_H_ */
110 #endif /* _LIMITS_H___ */
111 /* This administrivia gets added to the end of limits.h
112 if the system has its own version of limits.h. */
114 #else /* not _GCC_LIMITS_H_ */
116 #ifdef _GCC_NEXT_LIMITS_H
117 #include_next <limits.h> /* recurse down to the real one */
120 #endif /* not _GCC_LIMITS_H_ */