3
0

fix_u32.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 GPLv2, see file LICENSE in this source tree.
  7. */
  8. #ifndef FIX_U32_H
  9. #define FIX_U32_H 1
  10. /* Try hard to pull in u32 types and such.
  11. * Otherwise, #include "fix_u32.h" + #include <linux/foo.h>
  12. * may end up typedef'ing bb_hack_u32 inside foo.h,
  13. * and repeated typedefs aren't allowed in C/C++.
  14. */
  15. #include <asm/types.h>
  16. #include <linux/types.h>
  17. /* In case above includes still failed to provide the types,
  18. * provide them ourself
  19. */
  20. #undef __u64
  21. #undef u64
  22. #undef u32
  23. #undef u16
  24. #undef u8
  25. #undef __s64
  26. #undef s64
  27. #undef s32
  28. #undef s16
  29. #undef s8
  30. #define __u64 bb_hack___u64
  31. #define u64 bb_hack_u64
  32. #define u32 bb_hack_u32
  33. #define u16 bb_hack_u16
  34. #define u8 bb_hack_u8
  35. #define __s64 bb_hack___s64
  36. #define s64 bb_hack_s64
  37. #define s32 bb_hack_s32
  38. #define s16 bb_hack_s16
  39. #define s8 bb_hack_s8
  40. typedef uint64_t __u64;
  41. typedef uint64_t u64;
  42. typedef uint32_t u32;
  43. typedef uint16_t u16;
  44. typedef uint8_t u8;
  45. typedef int64_t __s64;
  46. typedef int64_t s64;
  47. typedef int32_t s32;
  48. typedef int16_t s16;
  49. typedef int8_t s8;
  50. #endif