[Listener] Fix byte order macros for OpenBSD >= 5.6
This commit is contained in:
parent
550d9008db
commit
78f13f2c0b
|
@ -62,11 +62,22 @@
|
||||||
# else // __BYTE_ORDER
|
# else // __BYTE_ORDER
|
||||||
# error "This program does not handle strange architectures."
|
# error "This program does not handle strange architectures."
|
||||||
# endif // __BYTE_ORDER
|
# endif // __BYTE_ORDER
|
||||||
|
/* Non-glibc systems (mostly BSDs at this point).
|
||||||
|
* - OpenBSD 5.6 and higher defines le*toh in <endian.h>. Former versions
|
||||||
|
* defined letoh* in <sys/types.h>.
|
||||||
|
* - NetBSD, FreeBSD and DragonFly define le*toh in <sys/endian.h>.
|
||||||
|
*/
|
||||||
#else // __GLIBC__
|
#else // __GLIBC__
|
||||||
# include <sys/endian.h>
|
# if defined(OpenBSD)
|
||||||
# ifdef OpenBSD
|
# if OpenBSD < 201411 // OpenBSD < 5.6
|
||||||
|
# include <sys/types.h>
|
||||||
# define le32toh letoh32
|
# define le32toh letoh32
|
||||||
# define le16toh letoh16
|
# define le16toh letoh16
|
||||||
|
# else // OpenBSD < 5.6
|
||||||
|
# include <endian.h>
|
||||||
|
# endif // OpenBSD < 5.6
|
||||||
|
# else // OpenBSD
|
||||||
|
# include <sys/endian.h>
|
||||||
# endif // OpenBSD
|
# endif // OpenBSD
|
||||||
#endif // __GLIBC__
|
#endif // __GLIBC__
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue