]>
git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/machine/limits.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
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. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
30 #if !defined (_LIMITS_H___) && !defined (_MACH_MACHLIMITS_H_)
32 #include <ppc/limits.h>
33 #elif defined (__i386__)
34 #include <i386/limits.h>
36 #error architecture not supported
41 #ifndef _MACH_MACHLIMITS_H_
43 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
45 #define _MACH_MACHLIMITS_H_
47 /* Number of bits in a `char'. */
51 /* Maximum length of a multibyte character. */
56 /* Minimum and maximum values a `signed char' can hold. */
58 #define SCHAR_MIN (-128)
62 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
66 /* Minimum and maximum values a `char' can hold. */
67 #ifdef __CHAR_UNSIGNED__
74 #define CHAR_MIN (-128)
79 /* Minimum and maximum values a `signed short int' can hold. */
81 #define SHRT_MIN (-32768)
83 #define SHRT_MAX 32767
85 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
87 #define USHRT_MAX 65535
89 /* Minimum and maximum values a `signed int' can hold. */
91 #define __INT_MAX__ 2147483647
94 #define INT_MIN (-INT_MAX-1)
96 #define INT_MAX __INT_MAX__
98 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
100 #define UINT_MAX (INT_MAX * 2U + 1)
102 /* Minimum and maximum values a `signed long int' can hold.
105 #define __LONG_MAX__ 2147483647L
108 #define LONG_MIN (-LONG_MAX-1)
110 #define LONG_MAX __LONG_MAX__
112 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
114 #define ULONG_MAX (LONG_MAX * 2UL + 1)
116 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
117 /* Minimum and maximum values a `signed long long int' can hold. */
118 #ifndef __LONG_LONG_MAX__
119 #define __LONG_LONG_MAX__ 9223372036854775807LL
122 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
124 #define LONG_LONG_MAX __LONG_LONG_MAX__
126 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
127 #undef ULONG_LONG_MAX
128 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
131 #endif /* _MACH_MACHLIMITS_H_ */
132 #endif /* _LIMITS_H___ */