Subversion Repositories tendra.SVN

Rev

Rev 71 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
#ifndef __HACKED_LIMITS_INCLUDED
2
#define __HACKED_LIMITS_INCLUDED
3
 
71 7u83 4
/*#include_next <limits.h>*/
2 7u83 5
 
71 7u83 6
 
7
/*
8
 * According to ANSI (section 2.2.4.2), the values below must be usable by
9
 * #if preprocessing directives.  Additionally, the expression must have the
10
 * same type as would an expression that is an object of the corresponding
11
 * type converted according to the integral promotions.  The subtraction for
12
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
13
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
14
 */
15
 
16
 
17
 
18
 
19
#define	__USHRT_MAX	0xffff		/* max value for an unsigned short */
20
#define	__SHRT_MAX	0x7fff		/* max value for a short */
21
#define	__SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
22
 
23
#define	__UINT_MAX	0xffffffff	/* max value for an unsigned int */
24
#define	__INT_MAX	0x7fffffff	/* max value for an int */
25
#define	__INT_MIN	(-0x7fffffff - 1)	/* min value for an int */
26
 
27
#ifdef	__LP64__
28
#define	__ULONG_MAX	0xffffffffffffffff	/* max for an unsigned long */
29
#define	__LONG_MAX	0x7fffffffffffffff	/* max for a long */
30
#define	__LONG_MIN	(-0x7fffffffffffffff - 1) /* min for a long */
31
#else
32
#define	__ULONG_MAX	0xffffffffUL
33
#define	__LONG_MAX	0x7fffffffL
34
#define	__LONG_MIN	(-0x7fffffffL - 1)
35
#endif
36
 
37
			/* max value for an unsigned long long */
38
#define	__ULLONG_MAX	0xffffffffffffffffULL
39
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
40
#define	__LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
41
 
42
#ifdef	__LP64__
43
#define	__SSIZE_MAX	__LONG_MAX	/* max value for a ssize_t */
44
#define	__SIZE_T_MAX	__ULONG_MAX	/* max value for a size_t */
45
#define	__OFF_MAX	__LONG_MAX	/* max value for an off_t */
46
#define	__OFF_MIN	__LONG_MIN	/* min value for an off_t */
47
/* Quads and longs are the same on the amd64.  Ensure they stay in sync. */
48
#define	__UQUAD_MAX	__ULONG_MAX	/* max value for a uquad_t */
49
#define	__QUAD_MAX	__LONG_MAX	/* max value for a quad_t */
50
#define	__QUAD_MIN	__LONG_MIN	/* min value for a quad_t */
51
#define	__LONG_BIT	64
52
#else
53
#define	__SSIZE_MAX	__INT_MAX
54
#define	__SIZE_T_MAX	__UINT_MAX
55
#define	__OFF_MAX	__LLONG_MAX
56
#define	__OFF_MIN	__LLONG_MIN
57
#define	__UQUAD_MAX	__ULLONG_MAX
58
#define	__QUAD_MAX	__LLONG_MAX
59
#define	__QUAD_MIN	__LLONG_MIN
60
#define	__LONG_BIT	32
61
#endif
62
 
63
#define	__WORD_BIT	32
64
 
65
/* Minimum signal stack size. */
66
#define	__MINSIGSTKSZ	(512 * 4)
67
 
68
 
69
 
2 7u83 70
#ifndef NL_ARGMAX
71
#define NL_ARGMAX	99
72
#endif
73
 
74
#ifndef NL_LANGMAX
75
#define NL_LANGMAX	31
76
#endif
77
 
78
#ifndef NL_MSGMAX
79
#define NL_MSGMAX	32767
80
#endif
81
 
82
#ifndef NL_NMAX
83
#define NL_NMAX		1
84
#endif
85
 
86
#ifndef NL_SETMAX
87
#define NL_SETMAX	255
88
#endif
89
 
90
#ifndef NL_TEXTMAX
91
#define NL_TEXTMAX	2048
92
#endif
93
 
94
#ifndef NZERO
95
#define NZERO		0
96
#endif
97
 
98
#ifndef WORD_BIT
99
#define WORD_BIT	32
100
#endif
101
 
102
#ifndef LONG_BIT
103
#define LONG_BIT	32
104
#endif
105
 
71 7u83 106
#define	CHAR_BIT	8		/* number of bits in a char */
107
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
108
#define	SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
109
#define	UCHAR_MAX	0xff		/* max value for an unsigned char */
110
#define	MB_LEN_MAX	6		/* 31-bit UTF-8 */
111
 
112
#ifdef __CHAR_UNSIGNED__
113
#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
114
#define	CHAR_MIN	0		/* min value for a char */
115
#else
116
#define	CHAR_MAX	SCHAR_MAX
117
#define	CHAR_MIN	SCHAR_MIN
2 7u83 118
#endif
71 7u83 119
 
120
#define	USHRT_MAX	__USHRT_MAX	/* max value for an unsigned short */
121
#define	SHRT_MAX	__SHRT_MAX	/* max value for a short */
122
#define	SHRT_MIN	__SHRT_MIN	/* min value for a short */
123
 
124
#define	UINT_MAX	__UINT_MAX	/* max value for an unsigned int */
125
#define	INT_MAX		__INT_MAX	/* max value for an int */
126
#define	INT_MIN		__INT_MIN	/* min value for an int */
127
 
128
#define	ULONG_MAX	__ULONG_MAX	/* max for an unsigned long */
129
#define	LONG_MAX	__LONG_MAX	/* max for a long */
130
#define	LONG_MIN	__LONG_MIN	/* min for a long */
131
 
132
#
72 7u83 133
#define	NGROUPS_MAX	 	 1023
71 7u83 134
 
72 7u83 135
 
71 7u83 136
#endif