From c1ad89170d19312311699f1d36990ab504542e5c Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 16 Oct 2014 10:42:05 +0200 Subject: [PATCH] build: look for and use sys/endian.h Some OSes have sys/endian.h instead of glibc's endian.h. --- configure.ac | 1 + daemon/journal.c | 5 +++++ src/inspect-apps.c | 3 +++ src/inspect-fs-windows.c | 3 +++ src/journal.c | 3 +++ 5 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 6c3344405..8cd29d75e 100644 --- a/configure.ac +++ b/configure.ac @@ -288,6 +288,7 @@ AC_CHECK_HEADERS([\ attr/xattr.h \ byteswap.h \ endian.h \ + sys/endian.h \ errno.h \ linux/fs.h \ linux/raid/md_u.h \ diff --git a/daemon/journal.c b/daemon/journal.c index 3fd21355d..a2a1c734b 100644 --- a/daemon/journal.c +++ b/daemon/journal.c @@ -22,7 +22,12 @@ #include #include #include +#ifdef HAVE_ENDIAN_H #include +#endif +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif #include "guestfs_protocol.h" #include "daemon.h" diff --git a/src/inspect-apps.c b/src/inspect-apps.c index a77e9ce68..b62b432d5 100644 --- a/src/inspect-apps.c +++ b/src/inspect-apps.c @@ -31,6 +31,9 @@ #ifdef HAVE_ENDIAN_H #include #endif +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif /* be32toh is usually a macro definend in , but it might be * a function in some system so check both, and if neither is defined diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c index 20e4d7ff6..6d430d17c 100644 --- a/src/inspect-fs-windows.c +++ b/src/inspect-fs-windows.c @@ -32,6 +32,9 @@ #ifdef HAVE_ENDIAN_H #include #endif +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif #include diff --git a/src/journal.c b/src/journal.c index 61ab352ad..10700674d 100644 --- a/src/journal.c +++ b/src/journal.c @@ -31,6 +31,9 @@ #ifdef HAVE_ENDIAN_H #include #endif +#ifdef HAVE_SYS_ENDIAN_H +#include +#endif #include "full-read.h"