1 /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001,
2 2002 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
28 /* Number of bits in a `char'. */
30 #define CHAR_BIT __CHAR_BIT__
32 /* Maximum length of a multibyte character. */
37 /* Minimum and maximum values a `signed char' can hold. */
39 #define SCHAR_MIN (-SCHAR_MAX - 1)
41 #define SCHAR_MAX __SCHAR_MAX__
43 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
45 #if __SCHAR_MAX__ == __INT_MAX__
46 # define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
48 # define UCHAR_MAX (SCHAR_MAX * 2 + 1)
51 /* Minimum and maximum values a `char' can hold. */
52 #ifdef __CHAR_UNSIGNED__
54 # if __SCHAR_MAX__ == __INT_MAX__
60 # define CHAR_MAX UCHAR_MAX
63 # define CHAR_MIN SCHAR_MIN
65 # define CHAR_MAX SCHAR_MAX
68 /* Minimum and maximum values a `signed short int' can hold. */
70 #define SHRT_MIN (-SHRT_MAX - 1)
72 #define SHRT_MAX __SHRT_MAX__
74 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
76 #if __SHRT_MAX__ == __INT_MAX__
77 # define USHRT_MAX (SHRT_MAX * 2U + 1U)
79 # define USHRT_MAX (SHRT_MAX * 2 + 1)
82 /* Minimum and maximum values a `signed int' can hold. */
84 #define INT_MIN (-INT_MAX - 1)
86 #define INT_MAX __INT_MAX__
88 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
90 #define UINT_MAX (INT_MAX * 2U + 1U)
92 /* Minimum and maximum values a `signed long int' can hold.
95 #define LONG_MIN (-LONG_MAX - 1L)
97 #define LONG_MAX __LONG_MAX__
99 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
101 #define ULONG_MAX (LONG_MAX * 2UL + 1UL)
103 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
104 /* Minimum and maximum values a `signed long long int' can hold. */
106 # define LLONG_MIN (-LLONG_MAX - 1LL)
108 # define LLONG_MAX __LONG_LONG_MAX__
110 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
112 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
115 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
116 /* Minimum and maximum values a `signed long long int' can hold. */
117 # undef LONG_LONG_MIN
118 # define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
119 # undef LONG_LONG_MAX
120 # define LONG_LONG_MAX __LONG_LONG_MAX__
122 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
123 # undef ULONG_LONG_MAX
124 # define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
127 #endif /* _LIMITS_H___ */