From 3cb287919e69174eca2a7a2cf10ac537d973ee22 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 12 Oct 2010 15:39:46 +0200 Subject: misc: Attempt to determine byte order in a cross-platform way OSX does not provide an endian.h, use the other header files that should define/include what we need. Also check that the byteorder define is available. --- openbsc/src/mgcp/mgcp_network.c | 10 +++++++++- openbsc/src/rtp_proxy.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'openbsc/src') diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c index 5c57bf49a..28a27ca55 100644 --- a/openbsc/src/mgcp/mgcp_network.c +++ b/openbsc/src/mgcp/mgcp_network.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -40,6 +39,15 @@ #warning "Make use of the rtp proxy code" +/* attempt to determine byte order */ +#include +#include +#include + +#ifndef __BYTE_ORDER +#error "__BYTE_ORDER should be defined by someone" +#endif + /* according to rtp_proxy.c RFC 3550 */ struct rtp_hdr { #if __BYTE_ORDER == __LITTLE_ENDIAN diff --git a/openbsc/src/rtp_proxy.c b/openbsc/src/rtp_proxy.c index 924173dd2..a1f440d09 100644 --- a/openbsc/src/rtp_proxy.c +++ b/openbsc/src/rtp_proxy.c @@ -19,7 +19,6 @@ * */ -#include #include #include #include @@ -37,6 +36,15 @@ #include #include +/* attempt to determine byte order */ +#include +#include +#include + +#ifndef __BYTE_ORDER +#error "__BYTE_ORDER should be defined by someone" +#endif + static LLIST_HEAD(rtp_sockets); /* should we mangle the CNAME inside SDES of RTCP packets? We disable -- cgit v1.2.3