[Pkg-voip-commits] [resiprocate] 01/02: Fix for big endian build issues

Daniel Pocock pocock at alioth.debian.org
Mon Aug 5 20:24:53 UTC 2013


This is an automated email from the git hooks/post-receive script.

pocock pushed a commit to branch patch-queue/master
in repository resiprocate.

commit 130fd07278cb86fbc9aab573a7d61a03d992ea7f
Author: Daniel Pocock <daniel at pocock.com.au>
Date:   Thu Jul 18 20:50:42 2013 +0200

    Fix for big endian build issues
---
 rutil/Data.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/rutil/Data.cxx b/rutil/Data.cxx
index 753196a..14ec7e3 100644
--- a/rutil/Data.cxx
+++ b/rutil/Data.cxx
@@ -1967,6 +1967,19 @@ Data::rawCaseInsensitiveHash(const unsigned char* c, size_t size)
    return ntohl((u_long)st);
 }
 
+#if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
+
+#if !defined (get16bits)
+#define get16bits(d) ((((UInt32)(((const UInt8 *)(d))[0])) << 8)\
+                       +(UInt32)(((const UInt8 *)(d))[1]) )
+#endif
+
+#if !defined (get32bits)
+#define get32bits(d) ((get16bits(d) << 16) + get16bits(d+2))
+#endif
+
+#else
+
 #undef get16bits
 #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
   || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
@@ -1987,6 +2000,7 @@ Data::rawCaseInsensitiveHash(const unsigned char* c, size_t size)
 #if !defined (get32bits)
 #define get32bits(d) ((get16bits(d+2) << 16) + get16bits(d))
 #endif
+#endif
 
 // This is intended to be a faster case-insensitive hash function that works
 // well when the buffer is a RFC 3261 token.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/resiprocate.git



More information about the Pkg-voip-commits mailing list