Advertisement
Guest User

fix-linux-types-not-found.patch

a guest
Dec 12th, 2021
9
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Fixes tools/include/tools/be_byteshift.h:4:10: fatal error: linux/types.h: No such file or directory. Original idea from pmaports/device/testing/linux-huawei-alice/01_fix_types_include.patch. linux_types.h from https://github.com/DarkJoker360/android_kernel_huawei_alice/blob/cm-14.1/tools/include/tools/linux_types.h
  2. ---
  3. diff --git a/tools/include/tools/be_byteshift.h b/tools/include/tools/be_byteshift.h
  4. index f4912e26..cd041f3d 100644
  5. --- a/tools/include/tools/be_byteshift.h
  6. +++ b/tools/include/tools/be_byteshift.h
  7. @@ -1,7 +1,7 @@
  8. #ifndef _TOOLS_BE_BYTESHIFT_H
  9. #define _TOOLS_BE_BYTESHIFT_H
  10.  
  11. -#include <linux/types.h>
  12. +#include "linux_types.h"
  13.  
  14. static inline __u16 __get_unaligned_be16(const __u8 *p)
  15. {
  16. diff --git a/tools/include/tools/le_byteshift.h b/tools/include/tools/le_byteshift.h
  17. index c99d45a6..94d8d2e2 100644
  18. --- a/tools/include/tools/le_byteshift.h
  19. +++ b/tools/include/tools/le_byteshift.h
  20. @@ -1,7 +1,7 @@
  21. #ifndef _TOOLS_LE_BYTESHIFT_H
  22. #define _TOOLS_LE_BYTESHIFT_H
  23.  
  24. -#include <linux/types.h>
  25. +#include "linux_types.h"
  26.  
  27. static inline __u16 __get_unaligned_le16(const __u8 *p)
  28. {
  29. diff --git a/tools/include/tools/linux_types.h b/tools/include/tools/linux_types.h
  30. new file mode 100644
  31. index 00000000..f07ef829
  32. --- /dev/null
  33. +++ b/tools/include/tools/linux_types.h
  34. @@ -0,0 +1,22 @@
  35. +#ifndef __LINUX_TYPES_H
  36. +#define __LINUX_TYPES_H
  37. +
  38. +#include <stdint.h>
  39. +
  40. +typedef uint8_t __u8;
  41. +typedef uint8_t __be8;
  42. +typedef uint8_t __le8;
  43. +
  44. +typedef uint16_t __u16;
  45. +typedef uint16_t __be16;
  46. +typedef uint16_t __le16;
  47. +
  48. +typedef uint32_t __u32;
  49. +typedef uint32_t __be32;
  50. +typedef uint32_t __le32;
  51. +
  52. +typedef uint64_t __u64;
  53. +typedef uint64_t __be64;
  54. +typedef uint64_t __le64;
  55. +
  56. +#endif
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement