Denys Vlasenko | 0568b6e | 2009-08-08 03:20:12 +0200 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * This header makes it easier to include kernel headers |
| 4 | * which use u32 and such. |
| 5 | * |
| 6 | * Licensed under the GPL version 2, see the file LICENSE in this tarball. |
| 7 | */ |
| 8 | #ifndef FIX_U32_H |
| 9 | #define FIX_U32_H 1 |
| 10 | |
Denys Vlasenko | 09b7672 | 2010-03-16 01:22:35 +0100 | [diff] [blame] | 11 | /* Try hard to pull in u32 types and such. |
| 12 | * Otherwise, #include "fix_u32.h" + #include <linux/foo.h> |
| 13 | * may end up typedef'ing bb_hack_u32 inside foo.h, |
| 14 | * and repeated typedefs aren't allowed in C/C++. |
| 15 | */ |
| 16 | #include <asm/types.h> |
| 17 | #include <linux/types.h> |
| 18 | |
| 19 | /* In case above includes still failed to provide the types, |
| 20 | * provide them ourself |
| 21 | */ |
Denys Vlasenko | 8cb4036 | 2010-03-06 20:50:29 +0100 | [diff] [blame] | 22 | #undef __u64 |
Denys Vlasenko | 0568b6e | 2009-08-08 03:20:12 +0200 | [diff] [blame] | 23 | #undef u64 |
| 24 | #undef u32 |
| 25 | #undef u16 |
| 26 | #undef u8 |
Denys Vlasenko | 8cb4036 | 2010-03-06 20:50:29 +0100 | [diff] [blame] | 27 | #undef __s64 |
Denys Vlasenko | 0568b6e | 2009-08-08 03:20:12 +0200 | [diff] [blame] | 28 | #undef s64 |
| 29 | #undef s32 |
| 30 | #undef s16 |
| 31 | #undef s8 |
| 32 | |
Denys Vlasenko | c77e478 | 2010-03-08 21:53:45 +0100 | [diff] [blame] | 33 | #define __u64 bb_hack___u64 |
Denys Vlasenko | 09b7672 | 2010-03-16 01:22:35 +0100 | [diff] [blame] | 34 | #define u64 bb_hack_u64 |
| 35 | #define u32 bb_hack_u32 |
| 36 | #define u16 bb_hack_u16 |
| 37 | #define u8 bb_hack_u8 |
Denys Vlasenko | c77e478 | 2010-03-08 21:53:45 +0100 | [diff] [blame] | 38 | #define __s64 bb_hack___s64 |
Denys Vlasenko | 09b7672 | 2010-03-16 01:22:35 +0100 | [diff] [blame] | 39 | #define s64 bb_hack_s64 |
| 40 | #define s32 bb_hack_s32 |
| 41 | #define s16 bb_hack_s16 |
| 42 | #define s8 bb_hack_s8 |
Denys Vlasenko | 0568b6e | 2009-08-08 03:20:12 +0200 | [diff] [blame] | 43 | |
Denys Vlasenko | 8cb4036 | 2010-03-06 20:50:29 +0100 | [diff] [blame] | 44 | typedef uint64_t __u64; |
Denys Vlasenko | 0568b6e | 2009-08-08 03:20:12 +0200 | [diff] [blame] | 45 | typedef uint64_t u64; |
| 46 | typedef uint32_t u32; |
| 47 | typedef uint16_t u16; |
| 48 | typedef uint8_t u8; |
Denys Vlasenko | 8cb4036 | 2010-03-06 20:50:29 +0100 | [diff] [blame] | 49 | typedef int64_t __s64; |
Denys Vlasenko | 0568b6e | 2009-08-08 03:20:12 +0200 | [diff] [blame] | 50 | typedef int64_t s64; |
| 51 | typedef int32_t s32; |
| 52 | typedef int16_t s16; |
| 53 | typedef int8_t s8; |
| 54 | |
| 55 | #endif |