From c3300620c68486619fd9c8e47a2552f6a913e09b Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 9 Feb 2017 22:31:55 +0100 Subject: lib, tools, ipcpd: Fix compilation on FreeBSD FreeBSD defines its own bswap64 in the header, which is now included correctly. POSIX requires XSI or RTS extensions to be enabled for the sa_sigaction field to be visible. Linux doesn't do the check correctly, but FreeBSD does. Removes the LOG_MISSING call which was deprecated with the last revision of the logging system. --- src/lib/byte_order.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/byte_order.h') diff --git a/src/lib/byte_order.h b/src/lib/byte_order.h index 9ee082af..364b06cc 100644 --- a/src/lib/byte_order.h +++ b/src/lib/byte_order.h @@ -49,7 +49,9 @@ #include #ifdef __GLIBC__ -# include +#include +#elif defined(__FreeBSD__) +#include #endif /* if x86 compatible cpu */ @@ -131,7 +133,8 @@ static inline uint32_t bswap_32(uint32_t x) { #if defined(__GNUC__) && (__GNUC__ >= 4) && \ (__GNUC__ > 4 || __GNUC_MINOR__ >= 3) #define bswap_64(x) __builtin_bswap64(x) -#elif !defined(__STRICT_ANSI__) +#elif !defined (bswap64) +#if !defined(__STRICT_ANSI__) static inline uint64_t bswap_64(uint64_t x) { union { uint64_t ll; @@ -145,6 +148,7 @@ static inline uint64_t bswap_64(uint64_t x) { #else #error "bswap_64 unsupported" #endif +#endif #ifdef CPU_BIG_ENDIAN #define be2me_32(x) (x) -- cgit v1.2.3