[openbsc PATCH 3/3] Set byte order defines when compiled on OSX

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Tobias Engel t-openbsc at tobias.org
Wed Oct 24 15:53:50 UTC 2012


Byte order defines have a DARWIN prefix on OSX so the values openbsc
expects are set from their Darwin counterparts when compiled on OSX.
---
 openbsc/src/libmgcp/mgcp_network.c |    8 +++++++-
 openbsc/src/libtrau/rtp_proxy.c    |    8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 848f8cd..8824dc8 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -42,7 +42,13 @@
 #include <limits.h>
 
 #ifndef __BYTE_ORDER
-#error "__BYTE_ORDER should be defined by someone"
+# ifdef __APPLE__
+#  define __BYTE_ORDER __DARWIN_BYTE_ORDER
+#  define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
+#  define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
+# else
+#  error "__BYTE_ORDER should be defined by someone"
+# endif
 #endif
 
 /* according to rtp_proxy.c RFC 3550 */
diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c
index 3d34ac6..f7c5a4f 100644
--- a/openbsc/src/libtrau/rtp_proxy.c
+++ b/openbsc/src/libtrau/rtp_proxy.c
@@ -42,7 +42,13 @@
 #include <limits.h>
 
 #ifndef __BYTE_ORDER
-#error "__BYTE_ORDER should be defined by someone"
+# ifdef __APPLE__
+#  define __BYTE_ORDER __DARWIN_BYTE_ORDER
+#  define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
+#  define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
+# else
+#  error "__BYTE_ORDER should be defined by someone"
+# endif
 #endif
 
 static LLIST_HEAD(rtp_sockets);
-- 
1.7.10.2 (Apple Git-33)





More information about the OpenBSC mailing list