@@ -174,6 +174,36 @@ static inline long IS_ERR(const void *ptr)
#define ULONG_MAX (~0UL)
#endif
+#ifndef __CHECKER__
+/*
+ * Since we're using primitive definitions from kernel-space, we need to
+ * define __KERNEL__ so that system header files know which definitions
+ * to use.
+ */
+#define __KERNEL__
+#include <asm/types.h>
+typedef __u32 u32;
+typedef __u64 u64;
+typedef __u16 u16;
+typedef __u8 u8;
+typedef __s64 s64;
+typedef __s32 s32;
+
+/*
+ * Continuing to define __KERNEL__ breaks others parts of the code, so
+ * we can just undefine it now that we have the correct headers...
+ */
+#undef __KERNEL__
+#else
+typedef unsigned int u32;
+typedef unsigned int __u32;
+typedef unsigned long long u64;
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef long long s64;
+typedef int s32;
+#endif
+
#if INT_MAX != 0x7fffffff
#error : sizeof(int) must be 4 for this program
#endif
Add __uXX class compatible definitions in defs.h Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> --- ubifs-utils/include/defs.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)