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