2000-12-21 Benjamin Kosnik <bkoz@redhat.com>
[official-gcc.git] / gcc / glimits.h
blob979e7155803e65eb83d4f92725fe464945f3a9e9
1 #ifndef _LIMITS_H___
2 #ifndef _MACH_MACHLIMITS_H_
4 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
5 #define _LIMITS_H___
6 #define _MACH_MACHLIMITS_H_
8 /* Number of bits in a `char'. */
9 #undef CHAR_BIT
10 #define CHAR_BIT 8
12 /* Maximum length of a multibyte character. */
13 #ifndef MB_LEN_MAX
14 #define MB_LEN_MAX 1
15 #endif
17 /* Minimum and maximum values a `signed char' can hold. */
18 #undef SCHAR_MIN
19 #define SCHAR_MIN (-128)
20 #undef SCHAR_MAX
21 #define SCHAR_MAX 127
23 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
24 #undef UCHAR_MAX
25 #define UCHAR_MAX 255
27 /* Minimum and maximum values a `char' can hold. */
28 #ifdef __CHAR_UNSIGNED__
29 #undef CHAR_MIN
30 #define CHAR_MIN 0
31 #undef CHAR_MAX
32 #define CHAR_MAX 255
33 #else
34 #undef CHAR_MIN
35 #define CHAR_MIN (-128)
36 #undef CHAR_MAX
37 #define CHAR_MAX 127
38 #endif
40 /* Minimum and maximum values a `signed short int' can hold. */
41 #undef SHRT_MIN
42 /* For the sake of 16 bit hosts, we may not use -32768 */
43 #define SHRT_MIN (-32767-1)
44 #undef SHRT_MAX
45 #define SHRT_MAX 32767
47 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
48 #undef USHRT_MAX
49 #define USHRT_MAX 65535
51 /* Minimum and maximum values a `signed int' can hold. */
52 #ifndef __INT_MAX__
53 #define __INT_MAX__ 2147483647
54 #endif
55 #undef INT_MIN
56 #define INT_MIN (-INT_MAX-1)
57 #undef INT_MAX
58 #define INT_MAX __INT_MAX__
60 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
61 #undef UINT_MAX
62 #define UINT_MAX (INT_MAX * 2U + 1)
64 /* Minimum and maximum values a `signed long int' can hold.
65 (Same as `int'). */
66 #ifndef __LONG_MAX__
67 #if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
68 #define __LONG_MAX__ 9223372036854775807L
69 #else
70 #define __LONG_MAX__ 2147483647L
71 #endif /* __alpha__ || sparc64 */
72 #endif
73 #undef LONG_MIN
74 #define LONG_MIN (-LONG_MAX-1)
75 #undef LONG_MAX
76 #define LONG_MAX __LONG_MAX__
78 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
79 #undef ULONG_MAX
80 #define ULONG_MAX (LONG_MAX * 2UL + 1)
82 #ifndef __LONG_LONG_MAX__
83 #define __LONG_LONG_MAX__ 9223372036854775807LL
84 #endif
86 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
87 /* Minimum and maximum values a `signed long long int' can hold. */
88 #undef LLONG_MIN
89 #define LLONG_MIN (-LLONG_MAX-1)
90 #undef LLONG_MAX
91 #define LLONG_MAX __LONG_LONG_MAX__
93 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
94 #undef ULLONG_MAX
95 #define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
96 #endif
98 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
99 /* Minimum and maximum values a `signed long long int' can hold. */
100 #undef LONG_LONG_MIN
101 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
102 #undef LONG_LONG_MAX
103 #define LONG_LONG_MAX __LONG_LONG_MAX__
105 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
106 #undef ULONG_LONG_MAX
107 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
108 #endif
110 #endif /* _MACH_MACHLIMITS_H_ */
111 #endif /* _LIMITS_H___ */