summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--pack.c13
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 92f0401..efc4976 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue May 7 12:07:35 2013 Tanaka Akira <akr@fsij.org>
+
+ * pack.c (swap32): Don't redefine it if it is already defined.
+ Bionic defines it.
+ (swap64): Ditto.
+
Mon May 6 20:50:37 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (socket_s_ip_address_list): Fill sin6_scope_id
diff --git a/pack.c b/pack.c
index 1300e43..644ffd9 100644
--- a/pack.c
+++ b/pack.c
@@ -100,9 +100,16 @@ TOKEN_PASTE(swap,x)(xtype z) \
return r; \
}
-#if GCC_VERSION_SINCE(4,3,0)
-# define swap32(x) __builtin_bswap32(x)
-# define swap64(x) __builtin_bswap64(x)
+#ifndef swap32
+# if GCC_VERSION_SINCE(4,3,0)
+# define swap32(x) __builtin_bswap32(x)
+# endif
+#endif
+
+#ifndef swap64
+# if GCC_VERSION_SINCE(4,3,0)
+# define swap64(x) __builtin_bswap64(x)
+# endif
#endif
#ifndef swap16