summary refs log tree commit diff
path: root/pkgs/development/libraries/audiofile
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-10-19 16:19:11 +0200
committerRobin Gloster <mail@glob.in>2017-01-25 20:12:33 +0100
commitd01d2db3d89beb7b0599c3251fd5127cd4bd58e2 (patch)
tree9bf5022c8457ce3b06e84a0c57e8c45613aeb916 /pkgs/development/libraries/audiofile
parent17a344a5daebf7796e5b25f45658359b6c0dfda2 (diff)
downloadnixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.tar
nixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.tar.gz
nixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.tar.bz2
nixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.tar.lz
nixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.tar.xz
nixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.tar.zst
nixlib-d01d2db3d89beb7b0599c3251fd5127cd4bd58e2.zip
audiofile: Fix build on GCC 6
http://hydra.nixos.org/build/42228674
Diffstat (limited to 'pkgs/development/libraries/audiofile')
-rw-r--r--pkgs/development/libraries/audiofile/default.nix2
-rw-r--r--pkgs/development/libraries/audiofile/gcc-6.patch30
2 files changed, 31 insertions, 1 deletions
diff --git a/pkgs/development/libraries/audiofile/default.nix b/pkgs/development/libraries/audiofile/default.nix
index c76115000cb0..78867881dc32 100644
--- a/pkgs/development/libraries/audiofile/default.nix
+++ b/pkgs/development/libraries/audiofile/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind";
   };
 
-  patches = [ ./CVE-2015-7747.patch ];
+  patches = [ ./CVE-2015-7747.patch ./gcc-6.patch ];
 
   meta = with stdenv.lib; {
     description = "Library for reading and writing audio files in various formats";
diff --git a/pkgs/development/libraries/audiofile/gcc-6.patch b/pkgs/development/libraries/audiofile/gcc-6.patch
new file mode 100644
index 000000000000..1a7edd5af9a1
--- /dev/null
+++ b/pkgs/development/libraries/audiofile/gcc-6.patch
@@ -0,0 +1,30 @@
+http://patchwork.ozlabs.org/patch/630200/
+
+From 28cfdbbcb96a69087c3d21faf69b5eae7bcf6d69 Mon Sep 17 00:00:00 2001
+From: Hodorgasm <nsane457@gmail.com>
+Date: Wed, 11 May 2016 21:42:07 -0400
+Subject: [PATCH] Cast to unsigned while left bit-shifting
+
+GCC-6 now treats the left bitwise-shift of a negative integer as nonconformant so explicitly cast to an unsigned int while bit-shifting.
+
+Downloaded from upstream PR:
+https://github.com/mpruett/audiofile/pull/28
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ libaudiofile/modules/SimpleModule.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h
+index 03c6c69..4014fb2 100644
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+ 	typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+ 
+ 	static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+-	static const int kMinSignedValue = -1 << kScaleBits;
++	static const int kMinSignedValue = static_cast<signed>(static_cast<unsigned>(-1) << kScaleBits);;
+ 
+ 	struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ 	{