From 249a81b7ff57d39af843cd267b60c0ce0400ce8d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 22 Mar 2015 09:03:42 +0100 Subject: endian: Be able to detect endian on GNU and BSD On GNU __BYTE_ORDER and __LITTLE_ENDIAN is defined and the include is "endian.h" on FreeBSD it is "sys/endian.h" and LITTLE_ENDIAN/_LITTLE_ENDIAN and BYTE_ORDER/_BYTE_ORDER is defined. Create a header file that defines OSMO_IS_LITTLE_ENDIAN and OSMO_IS_BIG_ENDIAN and can be used as #if OSMO_IS_LITTLE_ENDIAN do_little_endian #elif OSMO_IS_BIG_ENDIAN do_big_endian #else #error "Unknown endian" #endif --- include/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'include/Makefile.am') diff --git a/include/Makefile.am b/include/Makefile.am index 347f641a..181431b7 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -14,6 +14,7 @@ nobase_include_HEADERS = \ osmocom/core/crc64gen.h \ osmocom/core/crc8gen.h \ osmocom/core/crcgen.h \ + osmocom/core/endian.h \ osmocom/core/defs.h \ osmocom/core/gsmtap.h \ osmocom/core/gsmtap_util.h \ -- cgit v1.2.3