1#ifndef _LIBC_LIMITS_H_ 2# define _LIBC_LIMITS_H_ 1 3 4#include <newlib.h> 5#include "_ansi.h" 6 7 /* Indicate that we honor AEABI portability if requested. */ 8#if defined _AEABI_PORTABILITY_LEVEL && _AEABI_PORTABILITY_LEVEL != 0 && !defined _AEABI_PORTABLE 9# define _AEABI_PORTABLE 10#endif 11 12#ifdef _AEABI_PORTABLE 13extern _CONST int __aeabi_MB_LEN_MAX; 14# define MB_LEN_MAX (__aeabi_MB_LEN_MAX) 15#else 16# ifdef _MB_LEN_MAX 17# define MB_LEN_MAX _MB_LEN_MAX 18# else 19# define MB_LEN_MAX 1 20# endif 21#endif /* AEABI_PORTABLE */ 22 23/* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */ 24# ifndef NL_ARGMAX 25# define NL_ARGMAX 32 26# endif 27 28/* if do not have #include_next support, then we 29 have to define the limits here. */ 30# if !defined __GNUC__ || __GNUC__ < 2 31 32# ifndef _LIMITS_H 33# define _LIMITS_H 1 34 35# include <sys/config.h> 36 37/* Number of bits in a `char'. */ 38# undef CHAR_BIT 39# define CHAR_BIT 8 40 41/* Minimum and maximum values a `signed char' can hold. */ 42# undef SCHAR_MIN 43# define SCHAR_MIN (-128) 44# undef SCHAR_MAX 45# define SCHAR_MAX 127 46 47/* Maximum value an `unsigned char' can hold. (Minimum is 0). */ 48# undef UCHAR_MAX 49# define UCHAR_MAX 255 50 51/* Minimum and maximum values a `char' can hold. */ 52# ifdef __CHAR_UNSIGNED__ 53# undef CHAR_MIN 54# define CHAR_MIN 0 55# undef CHAR_MAX 56# define CHAR_MAX 255 57# else 58# undef CHAR_MIN 59# define CHAR_MIN (-128) 60# undef CHAR_MAX 61# define CHAR_MAX 127 62# endif 63 64/* Minimum and maximum values a `signed short int' can hold. */ 65# undef SHRT_MIN 66/* For the sake of 16 bit hosts, we may not use -32768 */ 67# define SHRT_MIN (-32767-1) 68# undef SHRT_MAX 69# define SHRT_MAX 32767 70 71/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ 72# undef USHRT_MAX 73# define USHRT_MAX 65535 74 75/* Minimum and maximum values a `signed int' can hold. */ 76# ifndef __INT_MAX__ 77# define __INT_MAX__ 2147483647 78# endif 79# undef INT_MIN 80# define INT_MIN (-INT_MAX-1) 81# undef INT_MAX 82# define INT_MAX __INT_MAX__ 83 84/* Maximum value an `unsigned int' can hold. (Minimum is 0). */ 85# undef UINT_MAX 86# define UINT_MAX (INT_MAX * 2U + 1) 87 88/* Minimum and maximum values a `signed long int' can hold. 89 (Same as `int'). */ 90# ifndef __LONG_MAX__ 91# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9) 92# define __LONG_MAX__ 9223372036854775807L 93# else 94# define __LONG_MAX__ 2147483647L 95# endif /* __alpha__ || sparc64 */ 96# endif 97# undef LONG_MIN 98# define LONG_MIN (-LONG_MAX-1) 99# undef LONG_MAX 100# define LONG_MAX __LONG_MAX__ 101 102/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ 103# undef ULONG_MAX 104# define ULONG_MAX (LONG_MAX * 2UL + 1) 105 106# ifndef __LONG_LONG_MAX__ 107# define __LONG_LONG_MAX__ 9223372036854775807LL 108# endif 109 110# if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 111/* Minimum and maximum values a `signed long long int' can hold. */ 112# undef LLONG_MIN 113# define LLONG_MIN (-LLONG_MAX-1) 114# undef LLONG_MAX 115# define LLONG_MAX __LONG_LONG_MAX__ 116 117/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ 118# undef ULLONG_MAX 119# define ULLONG_MAX (LLONG_MAX * 2ULL + 1) 120# endif 121 122# if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) 123/* Minimum and maximum values a `signed long long int' can hold. */ 124# undef LONG_LONG_MIN 125# define LONG_LONG_MIN (-LONG_LONG_MAX-1) 126# undef LONG_LONG_MAX 127# define LONG_LONG_MAX __LONG_LONG_MAX__ 128 129/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ 130# undef ULONG_LONG_MAX 131# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1) 132# endif 133 134# endif /* _LIMITS_H */ 135# endif /* GCC 2. */ 136 137#endif /* !_LIBC_LIMITS_H_ */ 138 139#if defined __GNUC__ && !defined _GCC_LIMITS_H_ 140/* `_GCC_LIMITS_H_' is what GCC's file defines. */ 141# include_next <limits.h> 142#endif /* __GNUC__ && !_GCC_LIMITS_H_ */ 143 144#ifndef _POSIX2_RE_DUP_MAX 145/* The maximum number of repeated occurrences of a regular expression 146 * permitted when using the interval notation `\{M,N\}'. */ 147#define _POSIX2_RE_DUP_MAX 255 148#endif /* _POSIX2_RE_DUP_MAX */ 149 150#ifndef ARG_MAX 151#define ARG_MAX 4096 152#endif 153 154#ifndef PATH_MAX 155#define PATH_MAX 4096 156#endif 157 158