Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / include / limits.h
blob893f10834f6c13947c71785371a7d55c84115937
1 #ifndef _LIBC_LIMITS_H_
2 # define _LIBC_LIMITS_H_ 1
4 #include <newlib.h>
5 #include <sys/cdefs.h>
6 #include <sys/syslimits.h>
8 # ifdef _MB_LEN_MAX
9 # define MB_LEN_MAX _MB_LEN_MAX
10 # else
11 # define MB_LEN_MAX 1
12 # endif
14 /* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */
15 # ifndef NL_ARGMAX
16 # define NL_ARGMAX 32
17 # endif
19 /* if do not have #include_next support, then we
20 have to define the limits here. */
21 # if !defined __GNUC__ || __GNUC__ < 2
23 # ifndef _LIMITS_H
24 # define _LIMITS_H 1
26 # include <sys/config.h>
28 /* Number of bits in a `char'. */
29 # undef CHAR_BIT
30 # define CHAR_BIT 8
32 /* Minimum and maximum values a `signed char' can hold. */
33 # undef SCHAR_MIN
34 # define SCHAR_MIN (-128)
35 # undef SCHAR_MAX
36 # define SCHAR_MAX 127
38 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
39 # undef UCHAR_MAX
40 # define UCHAR_MAX 255
42 /* Minimum and maximum values a `char' can hold. */
43 # ifdef __CHAR_UNSIGNED__
44 # undef CHAR_MIN
45 # define CHAR_MIN 0
46 # undef CHAR_MAX
47 # define CHAR_MAX 255
48 # else
49 # undef CHAR_MIN
50 # define CHAR_MIN (-128)
51 # undef CHAR_MAX
52 # define CHAR_MAX 127
53 # endif
55 /* Minimum and maximum values a `signed short int' can hold. */
56 # undef SHRT_MIN
57 /* For the sake of 16 bit hosts, we may not use -32768 */
58 # define SHRT_MIN (-32767-1)
59 # undef SHRT_MAX
60 # define SHRT_MAX 32767
62 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
63 # undef USHRT_MAX
64 # define USHRT_MAX 65535
66 /* Minimum and maximum values a `signed int' can hold. */
67 # ifndef __INT_MAX__
68 # define __INT_MAX__ 2147483647
69 # endif
70 # undef INT_MIN
71 # define INT_MIN (-INT_MAX-1)
72 # undef INT_MAX
73 # define INT_MAX __INT_MAX__
75 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
76 # undef UINT_MAX
77 # define UINT_MAX (INT_MAX * 2U + 1)
79 /* Minimum and maximum values a `signed long int' can hold.
80 (Same as `int'). */
81 # ifndef __LONG_MAX__
82 # if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
83 # define __LONG_MAX__ 9223372036854775807L
84 # else
85 # define __LONG_MAX__ 2147483647L
86 # endif /* __alpha__ || sparc64 */
87 # endif
88 # undef LONG_MIN
89 # define LONG_MIN (-LONG_MAX-1)
90 # undef LONG_MAX
91 # define LONG_MAX __LONG_MAX__
93 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
94 # undef ULONG_MAX
95 # define ULONG_MAX (LONG_MAX * 2UL + 1)
97 # ifndef __LONG_LONG_MAX__
98 # define __LONG_LONG_MAX__ 9223372036854775807LL
99 # endif
101 # if __ISO_C_VISIBLE >= 1999
102 /* Minimum and maximum values a `signed long long int' can hold. */
103 # undef LLONG_MIN
104 # define LLONG_MIN (-LLONG_MAX-1)
105 # undef LLONG_MAX
106 # define LLONG_MAX __LONG_LONG_MAX__
108 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
109 # undef ULLONG_MAX
110 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
111 # endif
113 # if __GNU_VISIBLE
114 /* Minimum and maximum values a `signed long long int' can hold. */
115 # undef LONG_LONG_MIN
116 # define LONG_LONG_MIN (-LONG_LONG_MAX-1)
117 # undef LONG_LONG_MAX
118 # define LONG_LONG_MAX __LONG_LONG_MAX__
120 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
121 # undef ULONG_LONG_MAX
122 # define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
123 # endif
125 # endif /* _LIMITS_H */
126 # endif /* GCC 2. */
128 #endif /* !_LIBC_LIMITS_H_ */
130 #if defined __GNUC__ && !defined _GCC_LIMITS_H_
131 /* `_GCC_LIMITS_H_' is what GCC's file defines. */
132 # include_next <limits.h>
133 #endif /* __GNUC__ && !_GCC_LIMITS_H_ */
135 #ifndef _POSIX2_RE_DUP_MAX
136 /* The maximum number of repeated occurrences of a regular expression
137 * permitted when using the interval notation `\{M,N\}'. */
138 #define _POSIX2_RE_DUP_MAX 255
139 #endif /* _POSIX2_RE_DUP_MAX */
141 #ifndef ARG_MAX
142 #define ARG_MAX 4096
143 #endif
145 #ifndef PATH_MAX
146 #define PATH_MAX 4096
147 #endif