From b82f0e99dd9fad68929e40c738bc6db3be01c33a Mon Sep 17 00:00:00 2001 From: Damien Stuart Date: Sun, 15 Mar 2009 14:37:35 +0000 Subject: [PATCH] Tweaked byte order determination for Solaris systems. git-svn-id: file:///home/mbr/svn/fwknop/trunk@74 510a4753-2344-4c79-9c09-4d669213fbeb --- configure.ac | 2 +- fko/fko_common.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fd8a7169..ecb71eca 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_PROG_LIBTOOL # Checks for header files. # AC_HEADER_STDC -AC_CHECK_HEADERS([ctype.h endian.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/endian.h sys/socket.h sys/time.h termios.h unistd.h]) +AC_CHECK_HEADERS([ctype.h endian.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/byteorder.h sys/endian.h sys/socket.h sys/time.h termios.h unistd.h]) # Type checks. # diff --git a/fko/fko_common.h b/fko/fko_common.h index 940555e9..eaffa7cb 100644 --- a/fko/fko_common.h +++ b/fko/fko_common.h @@ -63,6 +63,15 @@ #elif HAVE_SYS_ENDIAN_H /* FreeBSD has a sys/endian.h */ #include #define BYTEORDER _BYTE_ORDER +#elif HAVE_SYS_BYTEORDER_H /* Solaris (v10 at least) seems to have this */ + #include + #if defined(_BIG_ENDIAN) + #define BYTEORDER 4321 + #elif defined(_LITTLE_ENDIAN) + #define BYTEORDER 1234 + #else + #error unable to determine BYTEORDER + #endif #endif /* Convenient macros for wrapping sections in 'extern "C" {' constructs.