Rev 71 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#ifndef __HACKED_LIMITS_INCLUDED
#define __HACKED_LIMITS_INCLUDED
/*#include_next <limits.h>*/
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
*/
#define __USHRT_MAX 0xffff /* max value for an unsigned short */
#define __SHRT_MAX 0x7fff /* max value for a short */
#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
#define __UINT_MAX 0xffffffff /* max value for an unsigned int */
#define __INT_MAX 0x7fffffff /* max value for an int */
#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
#ifdef __LP64__
#define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */
#define __LONG_MAX 0x7fffffffffffffff /* max for a long */
#define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */
#else
#define __ULONG_MAX 0xffffffffUL
#define __LONG_MAX 0x7fffffffL
#define __LONG_MIN (-0x7fffffffL - 1)
#endif
/* max value for an unsigned long long */
#define __ULLONG_MAX 0xffffffffffffffffULL
#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */
#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
#ifdef __LP64__
#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
#define __OFF_MAX __LONG_MAX /* max value for an off_t */
#define __OFF_MIN __LONG_MIN /* min value for an off_t */
/* Quads and longs are the same on the amd64. Ensure they stay in sync. */
#define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */
#define __QUAD_MAX __LONG_MAX /* max value for a quad_t */
#define __QUAD_MIN __LONG_MIN /* min value for a quad_t */
#define __LONG_BIT 64
#else
#define __SSIZE_MAX __INT_MAX
#define __SIZE_T_MAX __UINT_MAX
#define __OFF_MAX __LLONG_MAX
#define __OFF_MIN __LLONG_MIN
#define __UQUAD_MAX __ULLONG_MAX
#define __QUAD_MAX __LLONG_MAX
#define __QUAD_MIN __LLONG_MIN
#define __LONG_BIT 32
#endif
#define __WORD_BIT 32
/* Minimum signal stack size. */
#define __MINSIGSTKSZ (512 * 4)
#ifndef NL_ARGMAX
#define NL_ARGMAX 99
#endif
#ifndef NL_LANGMAX
#define NL_LANGMAX 31
#endif
#ifndef NL_MSGMAX
#define NL_MSGMAX 32767
#endif
#ifndef NL_NMAX
#define NL_NMAX 1
#endif
#ifndef NL_SETMAX
#define NL_SETMAX 255
#endif
#ifndef NL_TEXTMAX
#define NL_TEXTMAX 2048
#endif
#ifndef NZERO
#define NZERO 0
#endif
#ifndef WORD_BIT
#define WORD_BIT 32
#endif
#ifndef LONG_BIT
#define LONG_BIT 32
#endif
#define CHAR_BIT 8 /* number of bits in a char */
#define SCHAR_MAX 0x7f /* max value for a signed char */
#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
#define UCHAR_MAX 0xff /* max value for an unsigned char */
#define MB_LEN_MAX 6 /* 31-bit UTF-8 */
#ifdef __CHAR_UNSIGNED__
#define CHAR_MAX UCHAR_MAX /* max value for a char */
#define CHAR_MIN 0 /* min value for a char */
#else
#define CHAR_MAX SCHAR_MAX
#define CHAR_MIN SCHAR_MIN
#endif
#define USHRT_MAX __USHRT_MAX /* max value for an unsigned short */
#define SHRT_MAX __SHRT_MAX /* max value for a short */
#define SHRT_MIN __SHRT_MIN /* min value for a short */
#define UINT_MAX __UINT_MAX /* max value for an unsigned int */
#define INT_MAX __INT_MAX /* max value for an int */
#define INT_MIN __INT_MIN /* min value for an int */
#define ULONG_MAX __ULONG_MAX /* max for an unsigned long */
#define LONG_MAX __LONG_MAX /* max for a long */
#define LONG_MIN __LONG_MIN /* min for a long */
#
#define NGROUPS_MAX 1023
#endif