aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_network.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-10-12 15:39:46 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-12 15:41:03 +0200
commit3cb287919e69174eca2a7a2cf10ac537d973ee22 (patch)
treeda8391c0fc4bbe5375a2d97f14e5ff94abd28469 /openbsc/src/mgcp/mgcp_network.c
parent88a5fa0a7536138424bad775b1bff083fa9a1c4f (diff)
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.
Diffstat (limited to 'openbsc/src/mgcp/mgcp_network.c')
-rw-r--r--openbsc/src/mgcp/mgcp_network.c10
1 files changed, 9 insertions, 1 deletions
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 <string.h>
#include <stdlib.h>
#include <unistd.h>
-#include <endian.h>
#include <errno.h>
#include <sys/socket.h>
@@ -40,6 +39,15 @@
#warning "Make use of the rtp proxy code"
+/* attempt to determine byte order */
+#include <sys/types.h>
+#include <sys/param.h>
+#include <limits.h>
+
+#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