1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 by Dave Chapman
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef __INTTYPES_H__
21 #define __INTTYPES_H__
26 #define INT8_MIN SCHAR_MIN
27 #define INT8_MAX SCHAR_MAX
28 #define UINT8_MAX UCHAR_MAX
29 #define int8_t signed char
30 #define uint8_t unsigned char
33 #if USHRT_MAX == 0xffff
35 #define INT16_MIN SHRT_MIN
36 #define INT16_MAX SHRT_MAX
37 #define UINT16_MAX USHRT_MAX
39 #define uint16_t unsigned short
44 #if ULONG_MAX == 0xfffffffful
46 #define INT32_MIN LONG_MIN
47 #define INT32_MAX LONG_MAX
48 #define UINT32_MAX ULONG_MAX
50 #define uint32_t unsigned long
52 #define INTPTR_MIN LONG_MIN
53 #define INTPTR_MAX LONG_MAX
54 #define UINTPTR_MAX ULONG_MAX
56 #define uintptr_t unsigned long
58 #elif UINT_MAX == 0xffffffffu
60 #define INT32_MIN INT_MIN
61 #define INT32_MAX INT_MAX
62 #define UINT32_MAX UINT_MAX
64 #define uint32_t unsigned int
70 #define LLONG_MIN ((long long)9223372036854775808ull)
74 #define LLONG_MAX 9223372036854775807ll
78 #define ULLONG_MAX 18446744073709551615ull
81 #if ULONG_MAX == 0xffffffffffffffffull
83 #define INT64_MIN LONG_MIN
84 #define INT64_MAX LONG_MAX
85 #define UINT64_MAX ULONG_MAX
87 #define uint64_t unsigned long
89 #define INTPTR_MIN LONG_MIN
90 #define INTPTR_MAX LONG_MAX
91 #define UINTPTR_MAX ULONG_MAX
93 #define uintptr_t unsigned long
97 #define INT64_MIN LLONG_MIN
98 #define INT64_MAX LLONG_MAX
99 #define UINT64_MAX ULLONG_MAX
100 #define int64_t long long
101 #define uint64_t unsigned long long
105 #endif /* __INTTYPES_H__ */