/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2001, 2002 Mike Barcroft <[email protected]>4* Copyright (c) 2001 The NetBSD Foundation, Inc.5* All rights reserved.6*7* This code is derived from software contributed to The NetBSD Foundation8* by Klaus Klein.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13* 1. Redistributions of source code must retain the above copyright14* notice, this list of conditions and the following disclaimer.15* 2. Redistributions in binary form must reproduce the above copyright16* notice, this list of conditions and the following disclaimer in the17* documentation and/or other materials provided with the distribution.18*19* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS20* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR22* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS23* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29* POSSIBILITY OF SUCH DAMAGE.30*/3132#ifndef _MACHINE__STDINT_H_33#define _MACHINE__STDINT_H_3435#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)3637#define INT8_C(c) (c)38#define INT16_C(c) (c)39#define INT32_C(c) (c)40#define INT64_C(c) (c ## LL)4142#define UINT8_C(c) (c)43#define UINT16_C(c) (c)44#define UINT32_C(c) (c ## U)45#define UINT64_C(c) (c ## ULL)4647#define INTMAX_C(c) INT64_C(c)48#define UINTMAX_C(c) UINT64_C(c)4950#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */5152#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)5354/*55* ISO/IEC 9899:199956* 7.18.2.1 Limits of exact-width integer types57*/58/* Minimum values of exact-width signed integer types. */59#define INT8_MIN (-0x7f-1)60#define INT16_MIN (-0x7fff-1)61#define INT32_MIN (-0x7fffffff-1)62#define INT64_MIN (-0x7fffffffffffffffLL-1)6364/* Maximum values of exact-width signed integer types. */65#define INT8_MAX 0x7f66#define INT16_MAX 0x7fff67#define INT32_MAX 0x7fffffff68#define INT64_MAX 0x7fffffffffffffffLL6970/* Maximum values of exact-width unsigned integer types. */71#define UINT8_MAX 0xff72#define UINT16_MAX 0xffff73#define UINT32_MAX 0xffffffffU74#define UINT64_MAX 0xffffffffffffffffULL7576/*77* ISO/IEC 9899:199978* 7.18.2.2 Limits of minimum-width integer types79*/80/* Minimum values of minimum-width signed integer types. */81#define INT_LEAST8_MIN INT8_MIN82#define INT_LEAST16_MIN INT16_MIN83#define INT_LEAST32_MIN INT32_MIN84#define INT_LEAST64_MIN INT64_MIN8586/* Maximum values of minimum-width signed integer types. */87#define INT_LEAST8_MAX INT8_MAX88#define INT_LEAST16_MAX INT16_MAX89#define INT_LEAST32_MAX INT32_MAX90#define INT_LEAST64_MAX INT64_MAX9192/* Maximum values of minimum-width unsigned integer types. */93#define UINT_LEAST8_MAX UINT8_MAX94#define UINT_LEAST16_MAX UINT16_MAX95#define UINT_LEAST32_MAX UINT32_MAX96#define UINT_LEAST64_MAX UINT64_MAX9798/*99* ISO/IEC 9899:1999100* 7.18.2.3 Limits of fastest minimum-width integer types101*/102/* Minimum values of fastest minimum-width signed integer types. */103#define INT_FAST8_MIN INT32_MIN104#define INT_FAST16_MIN INT32_MIN105#define INT_FAST32_MIN INT32_MIN106#define INT_FAST64_MIN INT64_MIN107108/* Maximum values of fastest minimum-width signed integer types. */109#define INT_FAST8_MAX INT32_MAX110#define INT_FAST16_MAX INT32_MAX111#define INT_FAST32_MAX INT32_MAX112#define INT_FAST64_MAX INT64_MAX113114/* Maximum values of fastest minimum-width unsigned integer types. */115#define UINT_FAST8_MAX UINT32_MAX116#define UINT_FAST16_MAX UINT32_MAX117#define UINT_FAST32_MAX UINT32_MAX118#define UINT_FAST64_MAX UINT64_MAX119120/*121* ISO/IEC 9899:1999122* 7.18.2.4 Limits of integer types capable of holding object pointers123*/124#define INTPTR_MIN INT32_MIN125#define INTPTR_MAX INT32_MAX126#define UINTPTR_MAX UINT32_MAX127128/*129* ISO/IEC 9899:1999130* 7.18.2.5 Limits of greatest-width integer types131*/132#define INTMAX_MIN INT64_MIN133#define INTMAX_MAX INT64_MAX134#define UINTMAX_MAX UINT64_MAX135136/*137* ISO/IEC 9899:1999138* 7.18.3 Limits of other integer types139*/140/* Limits of ptrdiff_t. */141#define PTRDIFF_MIN INT32_MIN142#define PTRDIFF_MAX INT32_MAX143144/* Limits of sig_atomic_t. */145#define SIG_ATOMIC_MIN INT32_MIN146#define SIG_ATOMIC_MAX INT32_MAX147148/* Limit of size_t. */149#define SIZE_MAX UINT32_MAX150151/* Limits of wint_t. */152#define WINT_MIN INT32_MIN153#define WINT_MAX INT32_MAX154155#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */156157#endif /* !_MACHINE__STDINT_H_ */158159160