LIBS="$saved_LIBS"
CFLAGS="$saved_CFLAGS"
+AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
+ int64_t, uint64_t])
+
+dnl check for Linux types
+AC_CHECK_HEADERS([linux/types.h])
+AC_CHECK_TYPES([__u8, __s8, __u16, __s16, __u32, __s32, __u64, __s64, __le16,
+ __be16, __le32, __be32, __le64, __be64], [], [], [[#include <linux/types.h>]])
+
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_CONST
# include <assert.h>
# define kfree(x) do { if (x) free(x); } while (0)
# define BUG_ON(x) assert(!(x))
+# include "include/int_types.h"
#endif
#include "crush.h"
# define kmalloc(x, f) malloc(x)
# define kfree(x) free(x)
/*# define DEBUG_INDEP*/
+# include "include/int_types.h"
#endif
#include "crush.h"
#include "acconfig.h"
-#if defined(__linux__)
+#ifdef HAVE_LINUX_TYPES_H
#include <linux/types.h>
#endif
# endif
#endif
-#if defined(__FreeBSD__)
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
-typedef int8_t __s8;
+#ifndef HAVE___U8
typedef uint8_t __u8;
-typedef int16_t __s16;
+#endif
+
+#ifndef HAVE___S8
+typedef int8_t __s8;
+#endif
+
+#ifndef HAVE___U16
typedef uint16_t __u16;
-typedef int32_t __s32;
+#endif
+
+#ifndef HAVE___S16
+typedef int16_t __s16;
+#endif
+
+#ifndef HAVE___U32
typedef uint32_t __u32;
-typedef int64_t __s64;
+#endif
+
+#ifndef HAVE___S32
+typedef int32_t __s32;
+#endif
+
+#ifndef HAVE___U64
typedef uint64_t __u64;
+#endif
+
+#ifndef HAVE___S64
+typedef int64_t __s64;
+#endif
#define __bitwise__
typedef __u64 __bitwise__ __be64;
#endif
-#endif