modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/limits.h (about) 1 /* Copyright (C) 1991-2018 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* 19 * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h> 20 */ 21 22 #ifndef _LIBC_LIMITS_H_ 23 #define _LIBC_LIMITS_H_ 1 24 25 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION 26 #include <bits/libc-header-start.h> 27 28 /* Maximum length of any multibyte character in any locale. 29 We define this value here since the gcc header does not define 30 the correct value. */ 31 #define MB_LEN_MAX 16 32 33 /* If we are not using GNU CC we have to define all the symbols ourself. 34 Otherwise use gcc's definitions (see below). */ 35 #if !defined __GNUC__ || __GNUC__ < 2 36 37 /* We only protect from multiple inclusion here, because all the other 38 #include's protect themselves, and in GCC 2 we may #include_next through 39 multiple copies of this file before we get to GCC's. */ 40 # ifndef _LIMITS_H 41 # define _LIMITS_H 1 42 43 #include <bits/wordsize.h> 44 45 /* We don't have #include_next. 46 Define ANSI <limits.h> for standard 32-bit words. */ 47 48 /* These assume 8-bit `char's, 16-bit `short int's, 49 and 32-bit `int's and `long int's. */ 50 51 /* Number of bits in a `char'. */ 52 # define CHAR_BIT 8 53 54 /* Minimum and maximum values a `signed char' can hold. */ 55 # define SCHAR_MIN (-128) 56 # define SCHAR_MAX 127 57 58 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ 59 # define UCHAR_MAX 255 60 61 /* Minimum and maximum values a `char' can hold. */ 62 # ifdef __CHAR_UNSIGNED__ 63 # define CHAR_MIN 0 64 # define CHAR_MAX UCHAR_MAX 65 # else 66 # define CHAR_MIN SCHAR_MIN 67 # define CHAR_MAX SCHAR_MAX 68 # endif 69 70 /* Minimum and maximum values a `signed short int' can hold. */ 71 # define SHRT_MIN (-32768) 72 # define SHRT_MAX 32767 73 74 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ 75 # define USHRT_MAX 65535 76 77 /* Minimum and maximum values a `signed int' can hold. */ 78 # define INT_MIN (-INT_MAX - 1) 79 # define INT_MAX 2147483647 80 81 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ 82 # define UINT_MAX 4294967295U 83 84 /* Minimum and maximum values a `signed long int' can hold. */ 85 # if __WORDSIZE == 64 86 # define LONG_MAX 9223372036854775807L 87 # else 88 # define LONG_MAX 2147483647L 89 # endif 90 # define LONG_MIN (-LONG_MAX - 1L) 91 92 /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ 93 # if __WORDSIZE == 64 94 # define ULONG_MAX 18446744073709551615UL 95 # else 96 # define ULONG_MAX 4294967295UL 97 # endif 98 99 # ifdef __USE_ISOC99 100 101 /* Minimum and maximum values a `signed long long int' can hold. */ 102 # define LLONG_MAX 9223372036854775807LL 103 # define LLONG_MIN (-LLONG_MAX - 1LL) 104 105 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ 106 # define ULLONG_MAX 18446744073709551615ULL 107 108 # endif /* ISO C99 */ 109 110 # endif /* limits.h */ 111 #endif /* GCC 2. */ 112 113 #endif /* !_LIBC_LIMITS_H_ */ 114 115 /* Get the compiler's limits.h, which defines almost all the ISO constants. 116 117 We put this #include_next outside the double inclusion check because 118 it should be possible to include this file more than once and still get 119 the definitions from gcc's header. */ 120 #if defined __GNUC__ && !defined _GCC_LIMITS_H_ 121 /* `_GCC_LIMITS_H_' is what GCC's file defines. */ 122 # include_next <limits.h> 123 #endif 124 125 /* The <limits.h> files in some gcc versions don't define LLONG_MIN, 126 LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for 127 ages are available. */ 128 #if defined __USE_ISOC99 && defined __GNUC__ 129 # ifndef LLONG_MIN 130 # define LLONG_MIN (-LLONG_MAX-1) 131 # endif 132 # ifndef LLONG_MAX 133 # define LLONG_MAX __LONG_LONG_MAX__ 134 # endif 135 # ifndef ULLONG_MAX 136 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1) 137 # endif 138 #endif 139 140 /* The integer width macros are not defined by GCC's <limits.h> before 141 GCC 7, or if _GNU_SOURCE rather than 142 __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */ 143 #if __GLIBC_USE (IEC_60559_BFP_EXT) 144 # ifndef CHAR_WIDTH 145 # define CHAR_WIDTH 8 146 # endif 147 # ifndef SCHAR_WIDTH 148 # define SCHAR_WIDTH 8 149 # endif 150 # ifndef UCHAR_WIDTH 151 # define UCHAR_WIDTH 8 152 # endif 153 # ifndef SHRT_WIDTH 154 # define SHRT_WIDTH 16 155 # endif 156 # ifndef USHRT_WIDTH 157 # define USHRT_WIDTH 16 158 # endif 159 # ifndef INT_WIDTH 160 # define INT_WIDTH 32 161 # endif 162 # ifndef UINT_WIDTH 163 # define UINT_WIDTH 32 164 # endif 165 # ifndef LONG_WIDTH 166 # define LONG_WIDTH __WORDSIZE 167 # endif 168 # ifndef ULONG_WIDTH 169 # define ULONG_WIDTH __WORDSIZE 170 # endif 171 # ifndef LLONG_WIDTH 172 # define LLONG_WIDTH 64 173 # endif 174 # ifndef ULLONG_WIDTH 175 # define ULLONG_WIDTH 64 176 # endif 177 #endif /* Use IEC_60559_BFP_EXT. */ 178 179 #ifdef __USE_POSIX 180 /* POSIX adds things to <limits.h>. */ 181 # include <bits/posix1_lim.h> 182 #endif 183 184 #ifdef __USE_POSIX2 185 # include <bits/posix2_lim.h> 186 #endif 187 188 #ifdef __USE_XOPEN 189 # include <bits/xopen_lim.h> 190 #endif