diff --git a/CREDITS b/CREDITS index fe839715..a8f969b8 100644 --- a/CREDITS +++ b/CREDITS @@ -235,3 +235,8 @@ Github user 'sgh7': on goes down. If this happens, it is expected that the native process monitoring feature in things like systemd or upstart will restart fwknopd. + +Jérémie Courrèges-Anglas and Ingo Feinerer + - Contributed a patch to fix endian detection on OpenBSD systems based on + information contained here: + https://www.opengroup.org/austin/docs/austin_514.txt diff --git a/lib/fko_common.h b/lib/fko_common.h index d7cbbb34..4c7d6fc0 100644 --- a/lib/fko_common.h +++ b/lib/fko_common.h @@ -91,9 +91,15 @@ /* Work out endianness */ -#if HAVE_ENDIAN_H /* Should cover most Linux systems */ +#ifdef HAVE_ENDIAN_H /* POSIX proposal, should cover most modern systems */ #include - #define BYTEORDER __BYTE_ORDER + #ifndef BYTE_ORDER + #ifdef _BYTE_ORDER + #define BYTE_ORDER _BYTE_ORDER + #elif defined(__BYTE_ORDER) + #define BYTE_ORDER __BYTE_ORDER + #endif + #endif #elif HAVE_SYS_ENDIAN_H /* FreeBSD has a sys/endian.h */ #include #define BYTEORDER _BYTE_ORDER