]>
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_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 #if !defined (_LIMITS_H___) && !defined (_MACH_MACHLIMITS_H_)
24 #include <ppc/limits.h>
25 #elif defined (__i386__)
26 #include <i386/limits.h>
28 #error architecture not supported
33 #ifndef _MACH_MACHLIMITS_H_
35 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
37 #define _MACH_MACHLIMITS_H_
39 /* Number of bits in a `char'. */
43 /* Maximum length of a multibyte character. */
48 /* Minimum and maximum values a `signed char' can hold. */
50 #define SCHAR_MIN (-128)
54 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
58 /* Minimum and maximum values a `char' can hold. */
59 #ifdef __CHAR_UNSIGNED__
66 #define CHAR_MIN (-128)
71 /* Minimum and maximum values a `signed short int' can hold. */
73 #define SHRT_MIN (-32768)
75 #define SHRT_MAX 32767
77 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
79 #define USHRT_MAX 65535
81 /* Minimum and maximum values a `signed int' can hold. */
83 #define __INT_MAX__ 2147483647
86 #define INT_MIN (-INT_MAX-1)
88 #define INT_MAX __INT_MAX__
90 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
92 #define UINT_MAX (INT_MAX * 2U + 1)
94 /* Minimum and maximum values a `signed long int' can hold.
97 #define __LONG_MAX__ 2147483647L
100 #define LONG_MIN (-LONG_MAX-1)
102 #define LONG_MAX __LONG_MAX__
104 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
106 #define ULONG_MAX (LONG_MAX * 2UL + 1)
108 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
109 /* Minimum and maximum values a `signed long long int' can hold. */
110 #ifndef __LONG_LONG_MAX__
111 #define __LONG_LONG_MAX__ 9223372036854775807LL
114 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
116 #define LONG_LONG_MAX __LONG_LONG_MAX__
118 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
119 #undef ULONG_LONG_MAX
120 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
123 #endif /* _MACH_MACHLIMITS_H_ */
124 #endif /* _LIMITS_H___ */