10SN/A/*- 29330SN/A * Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org> 30SN/A * Copyright (c) 2001 The NetBSD Foundation, Inc. 40SN/A * All rights reserved. 50SN/A * 60SN/A * This code is derived from software contributed to The NetBSD Foundation 72362SN/A * by Klaus Klein. 80SN/A * 92362SN/A * Redistribution and use in source and binary forms, with or without 100SN/A * modification, are permitted provided that the following conditions 110SN/A * are met: 120SN/A * 1. Redistributions of source code must retain the above copyright 130SN/A * notice, this list of conditions and the following disclaimer. 140SN/A * 2. Redistributions in binary form must reproduce the above copyright 150SN/A * notice, this list of conditions and the following disclaimer in the 160SN/A * documentation and/or other materials provided with the distribution. 170SN/A * 180SN/A * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 190SN/A * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 200SN/A * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 212362SN/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 222362SN/A * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 232362SN/A * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 240SN/A * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 250SN/A * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 260SN/A * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 270SN/A * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 280SN/A * POSSIBILITY OF SUCH DAMAGE. 290SN/A */ 300SN/A 310SN/A#ifdef __arm__ 328565SN/A#include <arm/_stdint.h> 330SN/A#else /* !__arm__ */ 340SN/A 350SN/A#ifndef _MACHINE__STDINT_H_ 360SN/A#define _MACHINE__STDINT_H_ 370SN/A 380SN/A#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) 390SN/A 400SN/A#define INT8_C(c) (c) 410SN/A#define INT16_C(c) (c) 420SN/A#define INT32_C(c) (c) 430SN/A#define INT64_C(c) (c ## L) 440SN/A 450SN/A#define UINT8_C(c) (c) 460SN/A#define UINT16_C(c) (c) 470SN/A#define UINT32_C(c) (c ## U) 480SN/A#define UINT64_C(c) (c ## UL) 490SN/A 500SN/A#define INTMAX_C(c) INT64_C(c) 510SN/A#define UINTMAX_C(c) UINT64_C(c) 5210425SN/A 530SN/A#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ 540SN/A 550SN/A#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) 560SN/A 570SN/A/* 580SN/A * ISO/IEC 9899:1999 590SN/A * 7.18.2.1 Limits of exact-width integer types 600SN/A */ 610SN/A/* Minimum values of exact-width signed integer types. */ 620SN/A#define INT8_MIN (-0x7f-1) 6310425SN/A#define INT16_MIN (-0x7fff-1) 640SN/A#define INT32_MIN (-0x7fffffff-1) 650SN/A#define INT64_MIN (-0x7fffffffffffffffL-1) 660SN/A 670SN/A/* Maximum values of exact-width signed integer types. */ 680SN/A#define INT8_MAX 0x7f 690SN/A#define INT16_MAX 0x7fff 700SN/A#define INT32_MAX 0x7fffffff 710SN/A#define INT64_MAX 0x7fffffffffffffffL 720SN/A 730SN/A/* Maximum values of exact-width unsigned integer types. */ 740SN/A#define UINT8_MAX 0xff 750SN/A#define UINT16_MAX 0xffff 760SN/A#define UINT32_MAX 0xffffffffU 770SN/A#define UINT64_MAX 0xffffffffffffffffUL 780SN/A 790SN/A/* 800SN/A * ISO/IEC 9899:1999 810SN/A * 7.18.2.2 Limits of minimum-width integer types 820SN/A */ 8310425SN/A/* Minimum values of minimum-width signed integer types. */ 840SN/A#define INT_LEAST8_MIN INT8_MIN 850SN/A#define INT_LEAST16_MIN INT16_MIN 860SN/A#define INT_LEAST32_MIN INT32_MIN 870SN/A#define INT_LEAST64_MIN INT64_MIN 880SN/A 890SN/A/* Maximum values of minimum-width signed integer types. */ 900SN/A#define INT_LEAST8_MAX INT8_MAX 910SN/A#define INT_LEAST16_MAX INT16_MAX 920SN/A#define INT_LEAST32_MAX INT32_MAX 930SN/A#define INT_LEAST64_MAX INT64_MAX 940SN/A 950SN/A/* Maximum values of minimum-width unsigned integer types. */ 960SN/A#define UINT_LEAST8_MAX UINT8_MAX 970SN/A#define UINT_LEAST16_MAX UINT16_MAX 980SN/A#define UINT_LEAST32_MAX UINT32_MAX 990SN/A#define UINT_LEAST64_MAX UINT64_MAX 1000SN/A 1010SN/A/* 1020SN/A * ISO/IEC 9899:1999 1030SN/A * 7.18.2.3 Limits of fastest minimum-width integer types 1040SN/A */ 1050SN/A/* Minimum values of fastest minimum-width signed integer types. */ 1060SN/A#define INT_FAST8_MIN INT32_MIN 1070SN/A#define INT_FAST16_MIN INT32_MIN 1080SN/A#define INT_FAST32_MIN INT32_MIN 1090SN/A#define INT_FAST64_MIN INT64_MIN 1100SN/A 1110SN/A/* Maximum values of fastest minimum-width signed integer types. */ 1120SN/A#define INT_FAST8_MAX INT32_MAX 1130SN/A#define INT_FAST16_MAX INT32_MAX 1140SN/A#define INT_FAST32_MAX INT32_MAX 1150SN/A#define INT_FAST64_MAX INT64_MAX 1160SN/A 1170SN/A/* Maximum values of fastest minimum-width unsigned integer types. */ 1180SN/A#define UINT_FAST8_MAX UINT32_MAX 1190SN/A#define UINT_FAST16_MAX UINT32_MAX 1200SN/A#define UINT_FAST32_MAX UINT32_MAX 1210SN/A#define UINT_FAST64_MAX UINT64_MAX 1220SN/A 1230SN/A/* 1240SN/A * ISO/IEC 9899:1999 1250SN/A * 7.18.2.4 Limits of integer types capable of holding object pointers 1260SN/A */ 127#define INTPTR_MIN INT64_MIN 128#define INTPTR_MAX INT64_MAX 129#define UINTPTR_MAX UINT64_MAX 130 131/* 132 * ISO/IEC 9899:1999 133 * 7.18.2.5 Limits of greatest-width integer types 134 */ 135#define INTMAX_MIN INT64_MIN 136#define INTMAX_MAX INT64_MAX 137#define UINTMAX_MAX UINT64_MAX 138 139/* 140 * ISO/IEC 9899:1999 141 * 7.18.3 Limits of other integer types 142 */ 143/* Limits of ptrdiff_t. */ 144#define PTRDIFF_MIN INT64_MIN 145#define PTRDIFF_MAX INT64_MAX 146 147/* Limits of sig_atomic_t. */ 148#define SIG_ATOMIC_MIN INT64_MIN 149#define SIG_ATOMIC_MAX INT64_MAX 150 151/* Limit of size_t. */ 152#define SIZE_MAX UINT64_MAX 153 154/* Limits of wint_t. */ 155#define WINT_MIN INT32_MIN 156#define WINT_MAX INT32_MAX 157 158#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ 159 160#endif /* !_MACHINE__STDINT_H_ */ 161 162#endif /* !__arm__ */ 163