summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-24 13:28:14 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-24 13:28:14 -0700
commit573112ee8695ee0d7c5134c26a23024c04872a75 (patch)
treeea8d4bbee799b2ffa1b28ac876375c2a09af117a
parentd3e22572b348e2d20c6c6221dac6b218ed50fd27 (diff)
downloadnasm-573112ee8695ee0d7c5134c26a23024c04872a75.tar.gz
endian.h: can be called sys/endian.h or machine/endian.h
On some platforms, endian.h may exist but be called sys/endian.h or machine/endian.h. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--configure.ac2
-rw-r--r--include/compiler.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 26f61f43..8db7c726 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,7 +88,7 @@ AC_CHECK_HEADERS(stdnoreturn.h)
AC_CHECK_HEADERS(io.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(unistd.h)
-AC_CHECK_HEADERS(endian.h)
+AC_CHECK_HEADERS(endian.h sys/endian.h machine/endian.h)
AC_CHECK_HEADERS(sys/mman.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/stat.h)
diff --git a/include/compiler.h b/include/compiler.h
index c068b72d..47d8595b 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -86,8 +86,13 @@
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
+
#ifdef HAVE_ENDIAN_H
# include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+# include <sys/endian.h>
+#elif defined(HAVE_MACHINE_ENDIAN_H)
+# include <machine/endian.h>
#endif
/*