1 |
148 |
jeremybenn |
/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2000 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, write to the Free
|
16 |
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
17 |
|
|
02111-1307 USA. */
|
18 |
|
|
|
19 |
|
|
/*
|
20 |
|
|
* ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h>
|
21 |
|
|
*/
|
22 |
|
|
|
23 |
|
|
#ifndef _LIBC_LIMITS_H_
|
24 |
|
|
#define _LIBC_LIMITS_H_ 1
|
25 |
|
|
|
26 |
|
|
#include <features.h>
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
/* Maximum length of any multibyte character in any locale.
|
30 |
|
|
We define this value here since the gcc header does not define
|
31 |
|
|
the correct value. */
|
32 |
|
|
#define MB_LEN_MAX 16
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
/* If we are not using GNU CC we have to define all the symbols ourself.
|
36 |
|
|
Otherwise use gcc's definitions (see below). */
|
37 |
|
|
#if !defined __GNUC__ || __GNUC__ < 2
|
38 |
|
|
|
39 |
|
|
/* We only protect from multiple inclusion here, because all the other
|
40 |
|
|
#include's protect themselves, and in GCC 2 we may #include_next through
|
41 |
|
|
multiple copies of this file before we get to GCC's. */
|
42 |
|
|
# ifndef _LIMITS_H
|
43 |
|
|
# define _LIMITS_H 1
|
44 |
|
|
|
45 |
|
|
#include <bits/wordsize.h>
|
46 |
|
|
|
47 |
|
|
/* We don't have #include_next.
|
48 |
|
|
Define ANSI <limits.h> for standard 32-bit words. */
|
49 |
|
|
|
50 |
|
|
/* These assume 8-bit `char's, 16-bit `short int's,
|
51 |
|
|
and 32-bit `int's and `long int's. */
|
52 |
|
|
|
53 |
|
|
/* Number of bits in a `char'. */
|
54 |
|
|
# define CHAR_BIT 8
|
55 |
|
|
|
56 |
|
|
/* Minimum and maximum values a `signed char' can hold. */
|
57 |
|
|
# define SCHAR_MIN (-128)
|
58 |
|
|
# define SCHAR_MAX 127
|
59 |
|
|
|
60 |
|
|
/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
|
61 |
|
|
# define UCHAR_MAX 255
|
62 |
|
|
|
63 |
|
|
/* Minimum and maximum values a `char' can hold. */
|
64 |
|
|
# ifdef __CHAR_UNSIGNED__
|
65 |
|
|
# define CHAR_MIN 0
|
66 |
|
|
# define CHAR_MAX UCHAR_MAX
|
67 |
|
|
# else
|
68 |
|
|
# define CHAR_MIN SCHAR_MIN
|
69 |
|
|
# define CHAR_MAX SCHAR_MAX
|
70 |
|
|
# endif
|
71 |
|
|
|
72 |
|
|
/* Minimum and maximum values a `signed short int' can hold. */
|
73 |
|
|
# define SHRT_MIN (-32768)
|
74 |
|
|
# define SHRT_MAX 32767
|
75 |
|
|
|
76 |
|
|
/* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
|
77 |
|
|
# define USHRT_MAX 65535
|
78 |
|
|
|
79 |
|
|
/* Minimum and maximum values a `signed int' can hold. */
|
80 |
|
|
# define INT_MIN (-INT_MAX - 1)
|
81 |
|
|
# define INT_MAX 2147483647
|
82 |
|
|
|
83 |
|
|
/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
|
84 |
|
|
# define UINT_MAX 4294967295U
|
85 |
|
|
|
86 |
|
|
/* Minimum and maximum values a `signed long int' can hold. */
|
87 |
|
|
# if __WORDSIZE == 64
|
88 |
|
|
# define LONG_MAX 9223372036854775807L
|
89 |
|
|
# else
|
90 |
|
|
# define LONG_MAX 2147483647L
|
91 |
|
|
# endif
|
92 |
|
|
# define LONG_MIN (-LONG_MAX - 1L)
|
93 |
|
|
|
94 |
|
|
/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
|
95 |
|
|
# if __WORDSIZE == 64
|
96 |
|
|
# define ULONG_MAX 18446744073709551615UL
|
97 |
|
|
# else
|
98 |
|
|
# define ULONG_MAX 4294967295UL
|
99 |
|
|
# endif
|
100 |
|
|
|
101 |
|
|
# ifdef __USE_ISOC99
|
102 |
|
|
|
103 |
|
|
/* Minimum and maximum values a `signed long long int' can hold. */
|
104 |
|
|
# define LLONG_MAX 9223372036854775807LL
|
105 |
|
|
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
106 |
|
|
|
107 |
|
|
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
|
108 |
|
|
# define ULLONG_MAX 18446744073709551615ULL
|
109 |
|
|
|
110 |
|
|
# endif /* ISO C99 */
|
111 |
|
|
|
112 |
|
|
# endif /* limits.h */
|
113 |
|
|
#endif /* GCC 2. */
|
114 |
|
|
|
115 |
|
|
#endif /* !_LIBC_LIMITS_H_ */
|
116 |
|
|
|
117 |
|
|
/* Get the compiler's limits.h, which defines almost all the ISO constants.
|
118 |
|
|
|
119 |
|
|
We put this #include_next outside the double inclusion check because
|
120 |
|
|
it should be possible to include this file more than once and still get
|
121 |
|
|
the definitions from gcc's header. */
|
122 |
|
|
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
|
123 |
|
|
/* `_GCC_LIMITS_H_' is what GCC's file defines. */
|
124 |
|
|
# include_next <limits.h>
|
125 |
|
|
|
126 |
|
|
/* The <limits.h> files in some gcc versions don't define LLONG_MIN,
|
127 |
|
|
LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
|
128 |
|
|
ages are available. */
|
129 |
|
|
# ifdef __USE_ISOC99
|
130 |
|
|
# ifndef LLONG_MIN
|
131 |
|
|
# define LLONG_MIN LONG_LONG_MIN
|
132 |
|
|
# endif
|
133 |
|
|
# ifndef LLONG_MAX
|
134 |
|
|
# define LLONG_MAX LONG_LONG_MAX
|
135 |
|
|
# endif
|
136 |
|
|
# ifndef ULLONG_MAX
|
137 |
|
|
# define ULLONG_MAX ULONG_LONG_MAX
|
138 |
|
|
# endif
|
139 |
|
|
# endif
|
140 |
|
|
#endif
|
141 |
|
|
|
142 |
|
|
#include <linux/limits.h>
|
143 |
|
|
|
144 |
|
|
#ifdef __USE_POSIX
|
145 |
|
|
/* POSIX adds things to <limits.h>. */
|
146 |
|
|
# include <bits/posix1_lim.h>
|
147 |
|
|
#endif
|
148 |
|
|
|
149 |
|
|
#ifdef __USE_POSIX2
|
150 |
|
|
# include <bits/posix2_lim.h>
|
151 |
|
|
#endif
|
152 |
|
|
|
153 |
|
|
#ifdef __USE_XOPEN
|
154 |
|
|
# include <bits/xopen_lim.h>
|
155 |
|
|
#endif
|
156 |
|
|
|