From eca862ff0f1b563da7f24c3636f92d5142a7d6ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Wed, 3 Dec 2014 15:47:33 +0100
Subject: [PATCH] contribs: Fix mpcdec build with MSVC

---
 contrib/src/mpcdec/musepack-asinh-msvc.patch | 11 +++++++++++
 contrib/src/mpcdec/rules.mak                 |  3 +++
 2 files changed, 14 insertions(+)
 create mode 100644 contrib/src/mpcdec/musepack-asinh-msvc.patch

diff --git a/contrib/src/mpcdec/musepack-asinh-msvc.patch b/contrib/src/mpcdec/musepack-asinh-msvc.patch
new file mode 100644
index 000000000000..c6bb01e2c468
--- /dev/null
+++ b/contrib/src/mpcdec/musepack-asinh-msvc.patch
@@ -0,0 +1,11 @@
+--- musepack.clean/libmpcpsy/psy_tab.c	2014-12-03 15:25:37.877616700 +0100
++++ musepack/libmpcpsy/psy_tab.c	2014-12-03 15:20:59.300071300 +0100
+@@ -186,7 +187,7 @@
+     }
+ }
+
+-#ifdef _MSC_VER
++#if defined(_MSC_VER) && _MSC_VER < 1800
+ static double
+ asinh ( double x )
+ {
diff --git a/contrib/src/mpcdec/rules.mak b/contrib/src/mpcdec/rules.mak
index ab5a6b46abc3..44cab857781a 100644
--- a/contrib/src/mpcdec/rules.mak
+++ b/contrib/src/mpcdec/rules.mak
@@ -28,6 +28,9 @@ musepack: musepack_src_r$(MUSE_REV).tar.gz .sum-mpcdec
 	$(UNPACK)
 	$(APPLY) $(SRC)/mpcdec/musepack-no-cflags-clobber.patch
 	$(APPLY) $(SRC)/mpcdec/musepack-no-binaries.patch
+ifdef HAVE_VISUALSTUDIO
+	$(APPLY) $(SRC)/mpcdec/musepack-asinh-msvc.patch
+endif
 	sed -i.orig \
 		-e 's,^add_subdirectory(mpcgain),,g' \
 		-e 's,^add_subdirectory(mpcchap),,g' \
-- 
GitLab