delete
[official-gcc.git] / gcc / glimits.h
blobc3b83da15f9b78a91b2bbe864b1ac7470a80c75f
1 #ifndef _LIMITS_H___
2 #define _LIMITS_H___
4 /* Number of bits in a `char'. */
5 #undef CHAR_BIT
6 #define CHAR_BIT 8
8 /* Maximum length of a multibyte character. */
9 #ifndef MB_LEN_MAX
10 #define MB_LEN_MAX 1
11 #endif
13 /* Minimum and maximum values a `signed char' can hold. */
14 #undef SCHAR_MIN
15 #define SCHAR_MIN (-128)
16 #undef SCHAR_MAX
17 #define SCHAR_MAX 127
19 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
20 #undef UCHAR_MAX
21 #define UCHAR_MAX 255
23 /* Minimum and maximum values a `char' can hold. */
24 #ifdef __CHAR_UNSIGNED__
25 #undef CHAR_MIN
26 #define CHAR_MIN 0
27 #undef CHAR_MAX
28 #define CHAR_MAX 255
29 #else
30 #undef CHAR_MIN
31 #define CHAR_MIN (-128)
32 #undef CHAR_MAX
33 #define CHAR_MAX 127
34 #endif
36 #ifndef __SHRT_MAX__
37 #define __SHRT_MAX__ 32767
38 #endif
40 /* Minimum and maximum values a `signed short int' can hold. */
41 #undef SHRT_MIN
42 #define SHRT_MIN (-SHRT_MAX-1)
43 #undef SHRT_MAX
44 #define SHRT_MAX __SHRT_MAX__
46 /* Minimum and maximum values a `signed int' can hold. */
47 #ifndef __INT_MAX__
48 #define __INT_MAX__ 2147483647
49 #endif
50 #undef INT_MIN
51 #define INT_MIN (-INT_MAX-1)
52 #undef INT_MAX
53 #define INT_MAX __INT_MAX__
55 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
56 #undef USHRT_MAX
57 #if __SHRT_MAX__ == __INT_MAX__
58 #define USHRT_MAX (SHRT_MAX * 2U + 1U)
59 #else
60 #define USHRT_MAX (SHRT_MAX * 2 + 1)
61 #endif
63 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
64 #undef UINT_MAX
65 #define UINT_MAX (INT_MAX * 2U + 1)
67 /* Minimum and maximum values a `signed long int' can hold.
68 (Same as `int'). */
69 #ifndef __LONG_MAX__
70 #if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
71 #define __LONG_MAX__ 9223372036854775807L
72 #else
73 #define __LONG_MAX__ 2147483647L
74 #endif /* __alpha__ || sparc64 */
75 #endif
76 #undef LONG_MIN
77 #define LONG_MIN (-LONG_MAX-1)
78 #undef LONG_MAX
79 #define LONG_MAX __LONG_MAX__
81 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
82 #undef ULONG_MAX
83 #define ULONG_MAX (LONG_MAX * 2UL + 1)
85 #ifndef __LONG_LONG_MAX__
86 #define __LONG_LONG_MAX__ 9223372036854775807LL
87 #endif
89 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
90 /* Minimum and maximum values a `signed long long int' can hold. */
91 #undef LLONG_MIN
92 #define LLONG_MIN (-LLONG_MAX-1)
93 #undef LLONG_MAX
94 #define LLONG_MAX __LONG_LONG_MAX__
96 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
97 #undef ULLONG_MAX
98 #define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
99 #endif
101 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
102 /* Minimum and maximum values a `signed long long int' can hold. */
103 #undef LONG_LONG_MIN
104 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
105 #undef LONG_LONG_MAX
106 #define LONG_LONG_MAX __LONG_LONG_MAX__
108 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
109 #undef ULONG_LONG_MAX
110 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
111 #endif
113 #endif /* _LIMITS_H___ */