/*-1* Copyright (c) 2001, 2002 Mike Barcroft <[email protected]>2* Copyright (c) 2001 The NetBSD Foundation, Inc.3* All rights reserved.4*5* This code is derived from software contributed to The NetBSD Foundation6* by Klaus Klein.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions10* are met:11* 1. Redistributions of source code must retain the above copyright12* notice, this list of conditions and the following disclaimer.13* 2. Redistributions in binary form must reproduce the above copyright14* notice, this list of conditions and the following disclaimer in the15* documentation and/or other materials provided with the distribution.16*17* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS18* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED19* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR20* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS21* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR22* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF23* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS24* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN25* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)26* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE27* POSSIBILITY OF SUCH DAMAGE.28*/2930#ifndef _MACHINE__STDINT_H_31#define _MACHINE__STDINT_H_3233#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)3435#define INT8_C(c) (c)36#define INT16_C(c) (c)37#define INT32_C(c) (c)38#define INT64_C(c) (c ## L)3940#define UINT8_C(c) (c)41#define UINT16_C(c) (c)42#define UINT32_C(c) (c ## U)43#define UINT64_C(c) (c ## UL)4445#define INTMAX_C(c) INT64_C(c)46#define UINTMAX_C(c) UINT64_C(c)4748#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */4950#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)5152/*53* ISO/IEC 9899:199954* 7.18.2.1 Limits of exact-width integer types55*/56/* Minimum values of exact-width signed integer types. */57#define INT8_MIN (-0x7f-1)58#define INT16_MIN (-0x7fff-1)59#define INT32_MIN (-0x7fffffff-1)60#define INT64_MIN (-0x7fffffffffffffffL-1)6162/* Maximum values of exact-width signed integer types. */63#define INT8_MAX 0x7f64#define INT16_MAX 0x7fff65#define INT32_MAX 0x7fffffff66#define INT64_MAX 0x7fffffffffffffffL6768/* Maximum values of exact-width unsigned integer types. */69#define UINT8_MAX 0xff70#define UINT16_MAX 0xffff71#define UINT32_MAX 0xffffffffU72#define UINT64_MAX 0xffffffffffffffffUL7374/*75* ISO/IEC 9899:199976* 7.18.2.2 Limits of minimum-width integer types77*/78/* Minimum values of minimum-width signed integer types. */79#define INT_LEAST8_MIN INT8_MIN80#define INT_LEAST16_MIN INT16_MIN81#define INT_LEAST32_MIN INT32_MIN82#define INT_LEAST64_MIN INT64_MIN8384/* Maximum values of minimum-width signed integer types. */85#define INT_LEAST8_MAX INT8_MAX86#define INT_LEAST16_MAX INT16_MAX87#define INT_LEAST32_MAX INT32_MAX88#define INT_LEAST64_MAX INT64_MAX8990/* Maximum values of minimum-width unsigned integer types. */91#define UINT_LEAST8_MAX UINT8_MAX92#define UINT_LEAST16_MAX UINT16_MAX93#define UINT_LEAST32_MAX UINT32_MAX94#define UINT_LEAST64_MAX UINT64_MAX9596/*97* ISO/IEC 9899:199998* 7.18.2.3 Limits of fastest minimum-width integer types99*/100/* Minimum values of fastest minimum-width signed integer types. */101#define INT_FAST8_MIN INT32_MIN102#define INT_FAST16_MIN INT32_MIN103#define INT_FAST32_MIN INT32_MIN104#define INT_FAST64_MIN INT64_MIN105106/* Maximum values of fastest minimum-width signed integer types. */107#define INT_FAST8_MAX INT32_MAX108#define INT_FAST16_MAX INT32_MAX109#define INT_FAST32_MAX INT32_MAX110#define INT_FAST64_MAX INT64_MAX111112/* Maximum values of fastest minimum-width unsigned integer types. */113#define UINT_FAST8_MAX UINT32_MAX114#define UINT_FAST16_MAX UINT32_MAX115#define UINT_FAST32_MAX UINT32_MAX116#define UINT_FAST64_MAX UINT64_MAX117118/*119* ISO/IEC 9899:1999120* 7.18.2.4 Limits of integer types capable of holding object pointers121*/122#define INTPTR_MIN INT64_MIN123#define INTPTR_MAX INT64_MAX124#define UINTPTR_MAX UINT64_MAX125126/*127* ISO/IEC 9899:1999128* 7.18.2.5 Limits of greatest-width integer types129*/130#define INTMAX_MIN INT64_MIN131#define INTMAX_MAX INT64_MAX132#define UINTMAX_MAX UINT64_MAX133134/*135* ISO/IEC 9899:1999136* 7.18.3 Limits of other integer types137*/138/* Limits of ptrdiff_t. */139#define PTRDIFF_MIN INT64_MIN140#define PTRDIFF_MAX INT64_MAX141142/* Limits of sig_atomic_t. */143#define SIG_ATOMIC_MIN INT64_MIN144#define SIG_ATOMIC_MAX INT64_MAX145146/* Limit of size_t. */147#define SIZE_MAX UINT64_MAX148149/* Limits of wint_t. */150#define WINT_MIN INT32_MIN151#define WINT_MAX INT32_MAX152153#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */154155#endif /* !_MACHINE__STDINT_H_ */156157158