aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_endian.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-30 22:10:33 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-30 22:10:33 +0000
commit3a628268d7abd1ff797edc1b76da13def62cb338 (patch)
tree3dd403736aec254bcea700887e0982013207c7bb /src/util/common_endian.c
parentec9338c28ca046638191baba9a7cc05a7a4dd28d (diff)
downloadgnunet-3a628268d7abd1ff797edc1b76da13def62cb338.tar.gz
gnunet-3a628268d7abd1ff797edc1b76da13def62cb338.zip
-fix endian test
Diffstat (limited to 'src/util/common_endian.c')
-rw-r--r--src/util/common_endian.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index 1867ba01d..117e575e4 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -32,9 +32,9 @@
32uint64_t 32uint64_t
33GNUNET_ntohll (uint64_t n) 33GNUNET_ntohll (uint64_t n)
34{ 34{
35#if __BYTE_ORDER == __BIG_ENDIAN || _BYTE_ORDER == _BIG_ENDIAN 35#if __BYTE_ORDER == __BIG_ENDIAN
36 return n; 36 return n;
37#elif __BYTE_ORDER == __LITTLE_ENDIAN || _BYTE_ORDER == _LITTLE_ENDIAN 37#elif __BYTE_ORDER == __LITTLE_ENDIAN
38 return (((uint64_t) ntohl (n)) << 32) + ntohl (n >> 32); 38 return (((uint64_t) ntohl (n)) << 32) + ntohl (n >> 32);
39#else 39#else
40 #error byteorder undefined 40 #error byteorder undefined
@@ -44,9 +44,9 @@ GNUNET_ntohll (uint64_t n)
44uint64_t 44uint64_t
45GNUNET_htonll (uint64_t n) 45GNUNET_htonll (uint64_t n)
46{ 46{
47#if __BYTE_ORDER == __BIG_ENDIAN || _BYTE_ORDER == _BIG_ENDIAN 47#if __BYTE_ORDER == __BIG_ENDIAN
48 return n; 48 return n;
49#elif __BYTE_ORDER == __LITTLE_ENDIAN || _BYTE_ORDER == _LITTLE_ENDIAN 49#elif __BYTE_ORDER == __LITTLE_ENDIAN
50 return (((uint64_t) htonl (n)) << 32) + htonl (n >> 32); 50 return (((uint64_t) htonl (n)) << 32) + htonl (n >> 32);
51#else 51#else
52 #error byteorder undefined 52 #error byteorder undefined