Endian fix for OpenBSD systems

Per github issue #257, Jérémie Courrèges-Anglas and Ingo Feinerer
contributed a patch to fix endian detection on OpenBSD systems. This is
based on information contained at:

https://www.opengroup.org/austin/docs/austin_514.txt
This commit is contained in:
Michael Rash 2017-09-09 09:06:07 -04:00
parent 78b3a215cb
commit 10d31064c3
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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 <endian.h>
#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 <sys/endian.h>
#define BYTEORDER _BYTE_ORDER