110-portability.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --- a/compr_lzo.c
  2. +++ b/compr_lzo.c
  3. @@ -24,7 +24,6 @@
  4. #include <stdint.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. -#include <asm/types.h>
  8. #include <linux/jffs2.h>
  9. #include <lzo/lzo1x.h>
  10. #include "compr.h"
  11. --- a/compr_zlib.c
  12. +++ b/compr_zlib.c
  13. @@ -35,7 +35,6 @@
  14. #include <stdint.h>
  15. #include <zlib.h>
  16. #include <stdio.h>
  17. -#include <asm/types.h>
  18. #include <linux/jffs2.h>
  19. #include "compr.h"
  20. --- a/rbtree.h
  21. +++ b/rbtree.h
  22. @@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
  23. #ifndef _LINUX_RBTREE_H
  24. #define _LINUX_RBTREE_H
  25. -#include <linux/kernel.h>
  26. -#include <linux/stddef.h>
  27. +#include <stddef.h>
  28. struct rb_node
  29. {
  30. @@ -131,7 +130,9 @@ static inline void rb_set_color(struct r
  31. #define RB_ROOT (struct rb_root) { NULL, }
  32. +#ifndef offsetof
  33. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  34. +#endif
  35. #define container_of(ptr, type, member) ({ \
  36. const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  37. --- a/include/mtd/ubi-media.h
  38. +++ b/include/mtd/ubi-media.h
  39. @@ -30,7 +30,15 @@
  40. #ifndef __UBI_MEDIA_H__
  41. #define __UBI_MEDIA_H__
  42. +#ifdef __linux__
  43. #include <asm/byteorder.h>
  44. +#else
  45. +#include <stdint.h>
  46. +typedef uint8_t __u8;
  47. +typedef uint16_t __be16;
  48. +typedef uint32_t __be32;
  49. +typedef uint64_t __be64;
  50. +#endif
  51. /* The version of UBI images supported by this implementation */
  52. #define UBI_VERSION 1