Wed Jan 8 09:01:39 2014 UTC ()
Use system supplied bswap32 and bswap64 macros on NetBSD.
Fixes build on NetBSD-5-i386 with builtin gcc.


(obache)
diff -r1.41 -r1.42 pkgsrc/security/libgcrypt/distinfo
diff -r0 -r1.1 pkgsrc/security/libgcrypt/patches/patch-cipher_bithelp.h

cvs diff -r1.41 -r1.42 pkgsrc/security/libgcrypt/distinfo (expand / switch to unified diff)

--- pkgsrc/security/libgcrypt/distinfo 2014/01/07 17:18:29 1.41
+++ pkgsrc/security/libgcrypt/distinfo 2014/01/08 09:01:39 1.42
@@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
1$NetBSD: distinfo,v 1.41 2014/01/07 17:18:29 richard Exp $ 1$NetBSD: distinfo,v 1.42 2014/01/08 09:01:39 obache Exp $
2 2
3SHA1 (libgcrypt-1.6.0.tar.bz2) = 43283c0b41c41e3d3bc13c2d8f937dfe2aaa1a77 3SHA1 (libgcrypt-1.6.0.tar.bz2) = 43283c0b41c41e3d3bc13c2d8f937dfe2aaa1a77
4RMD160 (libgcrypt-1.6.0.tar.bz2) = 33e4e45116a64999c4cd0d132a4a968612057f40 4RMD160 (libgcrypt-1.6.0.tar.bz2) = 33e4e45116a64999c4cd0d132a4a968612057f40
5Size (libgcrypt-1.6.0.tar.bz2) = 2499149 bytes 5Size (libgcrypt-1.6.0.tar.bz2) = 2499149 bytes
6SHA1 (patch-aa) = 7c46612f912d45dfd4ce4f4b510e72c00bd38585 6SHA1 (patch-aa) = 7c46612f912d45dfd4ce4f4b510e72c00bd38585
7SHA1 (patch-ab) = 6fac21daa26b7de3b13839d076f78a74400efce7 7SHA1 (patch-ab) = 6fac21daa26b7de3b13839d076f78a74400efce7
8SHA1 (patch-ad) = 19345b7d164521d526a44eb3f1a465ff09d8266c 8SHA1 (patch-ad) = 19345b7d164521d526a44eb3f1a465ff09d8266c
 9SHA1 (patch-cipher_bithelp.h) = cac163417fdbb0cda7d787887b00bfb060740e60
9SHA1 (patch-configure) = c4e10bdb7e00a44d507f5b964f3e71a63828cd0a 10SHA1 (patch-configure) = c4e10bdb7e00a44d507f5b964f3e71a63828cd0a

File Added: pkgsrc/security/libgcrypt/patches/Attic/patch-cipher_bithelp.h
$NetBSD: patch-cipher_bithelp.h,v 1.1 2014/01/08 09:01:39 obache Exp $

* NetBSD has bswap32 and bswap64 as macros.

--- cipher/bithelp.h.orig	2013-12-09 07:48:50.000000000 +0000
+++ cipher/bithelp.h
@@ -40,7 +40,7 @@ static inline u32 ror(u32 x, int n)
    provided helpers.  */
 #ifdef HAVE_BUILTIN_BSWAP32
 # define bswap32 __builtin_bswap32
-#else
+#elif !defined(__NetBSD__) && !defined(bswap32)
 static inline u32 bswap32(u32 x)
 {
 	return ((rol(x, 8) & 0x00ff00ffL) | (ror(x, 8) & 0xff00ff00L));
@@ -50,7 +50,7 @@ static inline u32 bswap32(u32 x)
 #ifdef HAVE_U64_TYPEDEF
 # ifdef HAVE_BUILTIN_BSWAP64
 #  define bswap64 __builtin_bswap64
-# else
+# elif !defined(__NetBSD__) && !defined(bswap64)
 static inline u64 bswap64(u64 x)
 {
 	return ((u64)bswap32(x) << 32) | (bswap32(x >> 32));