]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/machine/limits.h
xnu-792.6.56.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / machine / limits.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 #if !defined (_LIMITS_H___) && !defined (_MACH_MACHLIMITS_H_)
24 #if defined (__ppc__)
25 #include <ppc/limits.h>
26 #elif defined (__i386__)
27 #include <i386/limits.h>
28 #else
29 #error architecture not supported
30 #endif
31 #undef MB_LEN_MAX
32 #endif
33 #ifndef _LIMITS_H___
34 #ifndef _MACH_MACHLIMITS_H_
35
36 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
37 #define _LIMITS_H___
38 #define _MACH_MACHLIMITS_H_
39
40 /* Number of bits in a `char'. */
41 #undef CHAR_BIT
42 #define CHAR_BIT 8
43
44 /* Maximum length of a multibyte character. */
45 #ifndef MB_LEN_MAX
46 #define MB_LEN_MAX 1
47 #endif
48
49 /* Minimum and maximum values a `signed char' can hold. */
50 #undef SCHAR_MIN
51 #define SCHAR_MIN (-128)
52 #undef SCHAR_MAX
53 #define SCHAR_MAX 127
54
55 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
56 #undef UCHAR_MAX
57 #define UCHAR_MAX 255
58
59 /* Minimum and maximum values a `char' can hold. */
60 #ifdef __CHAR_UNSIGNED__
61 #undef CHAR_MIN
62 #define CHAR_MIN 0
63 #undef CHAR_MAX
64 #define CHAR_MAX 255
65 #else
66 #undef CHAR_MIN
67 #define CHAR_MIN (-128)
68 #undef CHAR_MAX
69 #define CHAR_MAX 127
70 #endif
71
72 /* Minimum and maximum values a `signed short int' can hold. */
73 #undef SHRT_MIN
74 #define SHRT_MIN (-32768)
75 #undef SHRT_MAX
76 #define SHRT_MAX 32767
77
78 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
79 #undef USHRT_MAX
80 #define USHRT_MAX 65535
81
82 /* Minimum and maximum values a `signed int' can hold. */
83 #ifndef __INT_MAX__
84 #define __INT_MAX__ 2147483647
85 #endif
86 #undef INT_MIN
87 #define INT_MIN (-INT_MAX-1)
88 #undef INT_MAX
89 #define INT_MAX __INT_MAX__
90
91 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
92 #undef UINT_MAX
93 #define UINT_MAX (INT_MAX * 2U + 1)
94
95 /* Minimum and maximum values a `signed long int' can hold.
96 (Same as `int'). */
97 #ifndef __LONG_MAX__
98 #define __LONG_MAX__ 2147483647L
99 #endif
100 #undef LONG_MIN
101 #define LONG_MIN (-LONG_MAX-1)
102 #undef LONG_MAX
103 #define LONG_MAX __LONG_MAX__
104
105 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
106 #undef ULONG_MAX
107 #define ULONG_MAX (LONG_MAX * 2UL + 1)
108
109 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
110 /* Minimum and maximum values a `signed long long int' can hold. */
111 #ifndef __LONG_LONG_MAX__
112 #define __LONG_LONG_MAX__ 9223372036854775807LL
113 #endif
114 #undef LONG_LONG_MIN
115 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
116 #undef LONG_LONG_MAX
117 #define LONG_LONG_MAX __LONG_LONG_MAX__
118
119 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
120 #undef ULONG_LONG_MAX
121 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
122 #endif
123
124 #endif /* _MACH_MACHLIMITS_H_ */
125 #endif /* _LIMITS_H___ */