]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Restore ability to compile in FreeBSD 192/head
authorMike Brady <mikebrady@eircom.net>
Mon, 28 Dec 2015 20:38:51 +0000 (20:38 +0000)
committerMike Brady <mikebrady@eircom.net>
Mon, 28 Dec 2015 20:38:51 +0000 (20:38 +0000)
common.h
rtp.c
shairport.c

index 01ce9de01da209be55236696a2ce8b988b786a14..4f67cd475977170de2a501a49147a28753c660e5 100644 (file)
--- a/common.h
+++ b/common.h
@@ -2,7 +2,6 @@
 #define _COMMON_H
 
 #include <stdint.h>
-#include <endian.h>
 #include <sys/socket.h>
 #include <libconfig.h>
 
 #define SAFAMILY sa_family
 #endif
 
+enum endian_type {
+  SS_LITTLE_ENDIAN = 0,
+  SS_PDP_ENDIAN,
+  SS_BIG_ENDIAN,
+} endian_type;
+
 enum stuffing_type {
   ST_basic = 0,
   ST_soxr,
diff --git a/rtp.c b/rtp.c
index 0e4f1aaf27416d43e9dbc0fea33ac98f41613734..328b9f41124faa20703cd4c1122d665d35c2d659 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -41,7 +41,7 @@
 #include "player.h"
 #include "rtp.h"
 
-#ifdef COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN
+#if defined(__linux__)
 #include <linux/in6.h>
 #endif
 
@@ -529,7 +529,7 @@ static int bind_port(SOCKADDR *remote, int *sock) {
 
     *sock = socket(remote->SAFAMILY, SOCK_DGRAM, IPPROTO_UDP);
     
-    #ifdef COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN
+    #if defined(__linux__)
     #ifdef AF_INET6
     // now, if we are on IPv6, prefer a public ipv6 address
     if (remote->SAFAMILY==AF_INET6) {
index 20fce74bc0db8c3b59f404fe21424bcd93d0f49d..e628689157b5fb82087d01a2e7ae51c1cb3a0e50 100644 (file)
@@ -655,11 +655,11 @@ int main(int argc, char **argv) {
   xn.arr[3] = 0x11;     /* Highest-address byte */
   
   if (xn.u32==0x11223344)
-    endianness = __LITTLE_ENDIAN;
+    endianness = SS_LITTLE_ENDIAN;
   else if (xn.u32==0x33441122)
-    endianness = __PDP_ENDIAN;
+    endianness = SS_PDP_ENDIAN;
   else if (xn.u32==0x44332211)
-    endianness = __BIG_ENDIAN;
+    endianness = SS_BIG_ENDIAN;
   else die("Can not recognise the endianness of the processor.");
   
   strcpy(configuration_file_path, "/etc/");
@@ -854,13 +854,13 @@ int main(int argc, char **argv) {
   daemon_log(LOG_NOTICE, "startup");
   
   switch (endianness) {
-    case __LITTLE_ENDIAN:
+    case SS_LITTLE_ENDIAN:
       debug(2,"The processor is running little-endian.");
       break;
-    case __BIG_ENDIAN:
+    case SS_BIG_ENDIAN:
       debug(2,"The processor is running big-endian.");
       break;
-    case __PDP_ENDIAN:
+    case SS_PDP_ENDIAN:
       debug(2,"The processor is running pdp-endian.");
       break; 
   }