From eb862e6fb78a783e12061b771f8db9bab786e25c Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Fri, 19 Apr 2013 19:32:43 -0300 Subject: [PATCH 4/4] configure: check for endianness --- configure.ac | 2 ++ lib/os.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 55eccdb..953107d 100644 --- a/configure.ac +++ b/configure.ac @@ -222,6 +222,8 @@ dnl -------------------------------------------------- AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:) +AC_CHECK_HEADERS(endian.h machine/endian.h sys/param.h inttypes.h) + dnl -------------------------------------------------- dnl Check for typedefs, structures, etc dnl -------------------------------------------------- diff --git a/lib/os.h b/lib/os.h index 276b4de..f9fae9e 100644 --- a/lib/os.h +++ b/lib/os.h @@ -21,6 +21,14 @@ #include "config.h" #endif +#if HAVE_ENDIAN_H +#include +#elif HAVE_MACHINE_ENDIAN_H +#include +#elif HAVE_SYS_PARAM_H +#include +#endif + #include #include -- 1.8.4