00001 /*- 00002 * Copyright (c) 2001, 2002 Mike Barcroft <[email protected]> 00003 * Copyright (c) 2001 The NetBSD Foundation, Inc. 00004 * All rights reserved. 00005 * 00006 * This code is derived from software contributed to The NetBSD Foundation 00007 * by Klaus Klein. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 2. Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in the 00016 * documentation and/or other materials provided with the distribution. 00017 * 3. All advertising materials mentioning features or use of this software 00018 * must display the following acknowledgement: 00019 * This product includes software developed by the NetBSD 00020 * Foundation, Inc. and its contributors. 00021 * 4. Neither the name of The NetBSD Foundation nor the names of its 00022 * contributors may be used to endorse or promote products derived 00023 * from this software without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 00026 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00027 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 00029 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00030 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00031 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00032 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00033 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00034 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00035 * POSSIBILITY OF SUCH DAMAGE. 00036 * 00037 * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.2 2004/05/18 16:04:57 stefanf Exp $ 00038 */ 00039 00040 #ifndef _MACHINE__STDINT_H_ 00041 #define _MACHINE__STDINT_H_ 00042 00043 #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) 00044 00045 #define INT8_C(c) (c) 00046 #define INT16_C(c) (c) 00047 #define INT32_C(c) (c) 00048 #define INT64_C(c) (c ## LL) 00049 00050 #define UINT8_C(c) (c) 00051 #define UINT16_C(c) (c) 00052 #define UINT32_C(c) (c ## U) 00053 #define UINT64_C(c) (c ## ULL) 00054 00055 #define INTMAX_C(c) (c ## LL) 00056 #define UINTMAX_C(c) (c ## ULL) 00057 00058 #endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ 00059 00060 #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) 00061 00062 /* 00063 * ISO/IEC 9899:1999 00064 * 7.18.2.1 Limits of exact-width integer types 00065 */ 00066 /* Minimum values of exact-width signed integer types. */ 00067 #define INT8_MIN (-0x7f-1) 00068 #define INT16_MIN (-0x7fff-1) 00069 #define INT32_MIN (-0x7fffffff-1) 00070 #define INT64_MIN (-0x7fffffffffffffffLL-1) 00071 00072 /* Maximum values of exact-width signed integer types. */ 00073 #define INT8_MAX 0x7f 00074 #define INT16_MAX 0x7fff 00075 #define INT32_MAX 0x7fffffff 00076 #define INT64_MAX 0x7fffffffffffffffLL 00077 00078 /* Maximum values of exact-width unsigned integer types. */ 00079 #define UINT8_MAX 0xff 00080 #define UINT16_MAX 0xffff 00081 #define UINT32_MAX 0xffffffffU 00082 #define UINT64_MAX 0xffffffffffffffffULL 00083 00084 /* 00085 * ISO/IEC 9899:1999 00086 * 7.18.2.2 Limits of minimum-width integer types 00087 */ 00088 /* Minimum values of minimum-width signed integer types. */ 00089 #define INT_LEAST8_MIN INT8_MIN 00090 #define INT_LEAST16_MIN INT16_MIN 00091 #define INT_LEAST32_MIN INT32_MIN 00092 #define INT_LEAST64_MIN INT64_MIN 00093 00094 /* Maximum values of minimum-width signed integer types. */ 00095 #define INT_LEAST8_MAX INT8_MAX 00096 #define INT_LEAST16_MAX INT16_MAX 00097 #define INT_LEAST32_MAX INT32_MAX 00098 #define INT_LEAST64_MAX INT64_MAX 00099 00100 /* Maximum values of minimum-width unsigned integer types. */ 00101 #define UINT_LEAST8_MAX UINT8_MAX 00102 #define UINT_LEAST16_MAX UINT16_MAX 00103 #define UINT_LEAST32_MAX UINT32_MAX 00104 #define UINT_LEAST64_MAX UINT64_MAX 00105 00106 /* 00107 * ISO/IEC 9899:1999 00108 * 7.18.2.3 Limits of fastest minimum-width integer types 00109 */ 00110 /* Minimum values of fastest minimum-width signed integer types. */ 00111 #define INT_FAST8_MIN INT32_MIN 00112 #define INT_FAST16_MIN INT32_MIN 00113 #define INT_FAST32_MIN INT32_MIN 00114 #define INT_FAST64_MIN INT64_MIN 00115 00116 /* Maximum values of fastest minimum-width signed integer types. */ 00117 #define INT_FAST8_MAX INT32_MAX 00118 #define INT_FAST16_MAX INT32_MAX 00119 #define INT_FAST32_MAX INT32_MAX 00120 #define INT_FAST64_MAX INT64_MAX 00121 00122 /* Maximum values of fastest minimum-width unsigned integer types. */ 00123 #define UINT_FAST8_MAX UINT32_MAX 00124 #define UINT_FAST16_MAX UINT32_MAX 00125 #define UINT_FAST32_MAX UINT32_MAX 00126 #define UINT_FAST64_MAX UINT64_MAX 00127 00128 /* 00129 * ISO/IEC 9899:1999 00130 * 7.18.2.4 Limits of integer types capable of holding object pointers 00131 */ 00132 #define INTPTR_MIN INT32_MIN 00133 #define INTPTR_MAX INT32_MAX 00134 #define UINTPTR_MAX UINT32_MAX 00135 00136 /* 00137 * ISO/IEC 9899:1999 00138 * 7.18.2.5 Limits of greatest-width integer types 00139 */ 00140 #define INTMAX_MIN INT64_MIN 00141 #define INTMAX_MAX INT64_MAX 00142 #define UINTMAX_MAX UINT64_MAX 00143 00144 /* 00145 * ISO/IEC 9899:1999 00146 * 7.18.3 Limits of other integer types 00147 */ 00148 /* Limits of ptrdiff_t. */ 00149 #define PTRDIFF_MIN INT32_MIN 00150 #define PTRDIFF_MAX INT32_MAX 00151 00152 /* Limits of sig_atomic_t. */ 00153 #define SIG_ATOMIC_MIN INT32_MIN 00154 #define SIG_ATOMIC_MAX INT32_MAX 00155 00156 /* Limit of size_t. */ 00157 #define SIZE_MAX UINT32_MAX 00158 00159 #ifndef WCHAR_MIN /* Also possibly defined in <wchar.h> */ 00160 /* Limits of wchar_t. */ 00161 #define WCHAR_MIN INT32_MIN 00162 #define WCHAR_MAX INT32_MAX 00163 #endif 00164 00165 /* Limits of wint_t. */ 00166 #define WINT_MIN INT32_MIN 00167 #define WINT_MAX INT32_MAX 00168 00169 #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ 00170 00171 #endif /* !_MACHINE__STDINT_H_ */