aboutsummaryrefslogtreecommitdiffstats
path: root/main/freeswitch/0001-sofia-sip-byte-order.patch
blob: 91952fe53323183bb384097ffaaa5e033cf583db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From fa276af16c696e505f66e6ca18ab343f985e8f2b Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 27 Jul 2016 07:31:16 +0000
Subject: [PATCH] sofia-sip: byte-order

---
 libs/sofia-sip/libsofia-sip-ua/tport/ws.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c
index 7fe9f18..27d95b2 100644
--- a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c
+++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c
@@ -703,14 +703,12 @@ ssize_t ws_close(wsh_t *wsh, int16_t reason)
 
 uint64_t hton64(uint64_t val)
 {
-	if (__BYTE_ORDER == __BIG_ENDIAN) return (val);
-	else return __bswap_64(val);
+	return be64toh(val);
 }
 
 uint64_t ntoh64(uint64_t val)
 {
-	if (__BYTE_ORDER == __BIG_ENDIAN) return (val);
-	else return __bswap_64(val);
+	return htobe64(val);
 }
 
 
-- 
2.9.1

diff --git a/libs/sofia-sip/configure.ac b/libs/sofia-sip/configure.ac
index ca6bd3a..3d5677b 100644
--- a/libs/sofia-sip/configure.ac
+++ b/libs/sofia-sip/configure.ac
@@ -218,7 +218,6 @@ fi
 AC_C_CONST
 AC_C_INLINE
 AC_C_INLINE_DEFINE
-AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
 
 AC_C_VAR_FUNC
 AC_C_MACRO_FUNCTION