Theme Editor: Implemented %xd tag with subimages
[kugel-rb.git] / firmware / libc / include / stdint.h
blob93f234c0e809fde336bd10532e3a915ca8c433a9
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Dave Chapman
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef __STDINT_H__
23 #define __STDINT_H__
25 #include <limits.h>
27 /* 8 bit */
28 #define INT8_MIN SCHAR_MIN
29 #define INT8_MAX SCHAR_MAX
30 #define UINT8_MAX UCHAR_MAX
31 #define int8_t signed char
32 #define uint8_t unsigned char
34 /* 16 bit */
35 #if USHRT_MAX == 0xffff
37 #define INT16_MIN SHRT_MIN
38 #define INT16_MAX SHRT_MAX
39 #define UINT16_MAX USHRT_MAX
40 #define int16_t short
41 #define uint16_t unsigned short
43 #endif
45 /* 32 bit */
46 #if ULONG_MAX == 0xfffffffful
48 #define INT32_MIN LONG_MIN
49 #define INT32_MAX LONG_MAX
50 #define UINT32_MAX ULONG_MAX
51 #define int32_t long
52 #define uint32_t unsigned long
54 #define INTPTR_MIN LONG_MIN
55 #define INTPTR_MAX LONG_MAX
56 #define UINTPTR_MAX ULONG_MAX
57 #define intptr_t long
58 #define uintptr_t unsigned long
60 #elif UINT_MAX == 0xffffffffu
62 #define INT32_MIN INT_MIN
63 #define INT32_MAX INT_MAX
64 #define UINT32_MAX UINT_MAX
65 #define int32_t int
66 #define uint32_t unsigned int
68 #endif
70 /* 64 bit */
71 #ifndef LLONG_MIN
72 #define LLONG_MIN ((long long)9223372036854775808ull)
73 #endif
75 #ifndef LLONG_MAX
76 #define LLONG_MAX 9223372036854775807ll
77 #endif
79 #ifndef ULLONG_MAX
80 #define ULLONG_MAX 18446744073709551615ull
81 #endif
83 #if ULONG_MAX == 0xffffffffffffffffull
85 #define INT64_MIN LONG_MIN
86 #define INT64_MAX LONG_MAX
87 #define UINT64_MAX ULONG_MAX
88 #define int64_t long
89 #define uint64_t unsigned long
91 #define INTPTR_MIN LONG_MIN
92 #define INTPTR_MAX LONG_MAX
93 #define UINTPTR_MAX ULONG_MAX
94 #define intptr_t long
95 #define uintptr_t unsigned long
97 #else
99 #define INT64_MIN LLONG_MIN
100 #define INT64_MAX LLONG_MAX
101 #define UINT64_MAX ULLONG_MAX
102 #define int64_t long long
103 #define uint64_t unsigned long long
105 #endif
107 #endif /* __STDINT_H__ */