summaryrefslogtreecommitdiff
path: root/archivers/advancecomp/patches
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2019-10-04 18:08:07 +0000
committernia <nia@pkgsrc.org>2019-10-04 18:08:07 +0000
commit07b480ff86c1f220b44db38480e1ebd14534a8a8 (patch)
treec5b63e81aaae3e911f6f215b4380243a94dfd4ec /archivers/advancecomp/patches
parent03d4f52f0bfaf2f7774977e83f528ed6e1605e52 (diff)
downloadpkgsrc-07b480ff86c1f220b44db38480e1ebd14534a8a8.tar.gz
advancecomp: Avoid compiler warnings due to redefining bswap* on NetBSD.
Diffstat (limited to 'archivers/advancecomp/patches')
-rw-r--r--archivers/advancecomp/patches/patch-libdeflate_compiler__gcc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/archivers/advancecomp/patches/patch-libdeflate_compiler__gcc.h b/archivers/advancecomp/patches/patch-libdeflate_compiler__gcc.h
new file mode 100644
index 00000000000..ce23d57b258
--- /dev/null
+++ b/archivers/advancecomp/patches/patch-libdeflate_compiler__gcc.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-libdeflate_compiler__gcc.h,v 1.3 2019/10/04 18:08:07 nia Exp $
+
+Avoid conflicts due to changing the prototypes of bswap32 and co.
+
+--- libdeflate/compiler_gcc.h.orig 2017-01-24 17:51:01.000000000 +0000
++++ libdeflate/compiler_gcc.h
+@@ -93,6 +93,9 @@
+ # define CPU_IS_LITTLE_ENDIAN() (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+ #endif
+
++#ifdef __NetBSD__
++#include <sys/endian.h>
++#else
+ #if GCC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16)
+ # define bswap16 __builtin_bswap16
+ #endif
+@@ -104,6 +107,7 @@
+ #if GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap64)
+ # define bswap64 __builtin_bswap64
+ #endif
++#endif
+
+ #if defined(__x86_64__) || defined(__i386__) || defined(__ARM_FEATURE_UNALIGNED)
+ # define UNALIGNED_ACCESS_IS_FAST 1