212-byteshift_portability.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- a/tools/include/tools/be_byteshift.h
  2. +++ b/tools/include/tools/be_byteshift.h
  3. @@ -1,6 +1,10 @@
  4. #ifndef _TOOLS_BE_BYTESHIFT_H
  5. #define _TOOLS_BE_BYTESHIFT_H
  6. +#ifndef __linux__
  7. +#include "linux_types.h"
  8. +#endif
  9. +
  10. #include <stdint.h>
  11. static inline uint16_t __get_unaligned_be16(const uint8_t *p)
  12. --- a/tools/include/tools/le_byteshift.h
  13. +++ b/tools/include/tools/le_byteshift.h
  14. @@ -1,6 +1,10 @@
  15. #ifndef _TOOLS_LE_BYTESHIFT_H
  16. #define _TOOLS_LE_BYTESHIFT_H
  17. +#ifndef __linux__
  18. +#include "linux_types.h"
  19. +#endif
  20. +
  21. #include <stdint.h>
  22. static inline uint16_t __get_unaligned_le16(const uint8_t *p)
  23. --- /dev/null
  24. +++ b/tools/include/tools/linux_types.h
  25. @@ -0,0 +1,22 @@
  26. +#ifndef __LINUX_TYPES_H
  27. +#define __LINUX_TYPES_H
  28. +
  29. +#include <stdint.h>
  30. +
  31. +typedef uint8_t __u8;
  32. +typedef uint8_t __be8;
  33. +typedef uint8_t __le8;
  34. +
  35. +typedef uint16_t __u16;
  36. +typedef uint16_t __be16;
  37. +typedef uint16_t __le16;
  38. +
  39. +typedef uint32_t __u32;
  40. +typedef uint32_t __be32;
  41. +typedef uint32_t __le32;
  42. +
  43. +typedef uint64_t __u64;
  44. +typedef uint64_t __be64;
  45. +typedef uint64_t __le64;
  46. +
  47. +#endif