[vlc-commits] contrib: flac: Backport an upstream patch to flac 1.3.3, fixing mingw clang builds

Martin Storsjö git at videolan.org
Wed Sep 4 10:03:45 CEST 2019


vlc | branch: master | Martin Storsjö <martin at martin.st> | Wed Sep  4 11:01:24 2019 +0300| [add9214fe78e54bd5fb4b876e8d68395fe690f7a] | committer: Martin Storsjö

contrib: flac: Backport an upstream patch to flac 1.3.3, fixing mingw clang builds

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=add9214fe78e54bd5fb4b876e8d68395fe690f7a
---

 contrib/src/flac/mingw-min-max.patch | 28 ++++++++++++++++++++++++++++
 contrib/src/flac/rules.mak           |  1 +
 2 files changed, 29 insertions(+)

diff --git a/contrib/src/flac/mingw-min-max.patch b/contrib/src/flac/mingw-min-max.patch
new file mode 100644
index 0000000000..55dc90e723
--- /dev/null
+++ b/contrib/src/flac/mingw-min-max.patch
@@ -0,0 +1,28 @@
+From 4a43f2bd4d7e12b5d994f48e18cf014008d204ce Mon Sep 17 00:00:00 2001
+From: sezero <sezero at users.sourceforge.net>
+Date: Mon, 5 Aug 2019 02:00:40 +0300
+Subject: [PATCH] Do not assume that sys/param.h defines MIN and MAX
+
+One such example is sys/param.h from MinGW.
+---
+ src/libFLAC/include/private/macros.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/libFLAC/include/private/macros.h b/src/libFLAC/include/private/macros.h
+index 02eada45..3a8072ec 100644
+--- a/src/libFLAC/include/private/macros.h
++++ b/src/libFLAC/include/private/macros.h
+@@ -51,8 +51,10 @@
+ /* Whatever other unix that has sys/param.h */
+ #elif defined(HAVE_SYS_PARAM_H)
+ #include <sys/param.h>
++#if defined(MIN) && defined(MAX)
+ #define flac_max(a,b) MAX(a,b)
+ #define flac_min(a,b) MIN(a,b)
++#endif
+ 
+ /* Windows VS has them in stdlib.h.. XXX:Untested */
+ #elif defined(_MSC_VER)
+-- 
+2.17.1
+
diff --git a/contrib/src/flac/rules.mak b/contrib/src/flac/rules.mak
index 6da2e0ebce..2d902e6a1e 100644
--- a/contrib/src/flac/rules.mak
+++ b/contrib/src/flac/rules.mak
@@ -15,6 +15,7 @@ $(TARBALLS)/flac-$(FLAC_VERSION).tar.xz:
 
 flac: flac-$(FLAC_VERSION).tar.xz .sum-flac
 	$(UNPACK)
+	$(APPLY) $(SRC)/flac/mingw-min-max.patch
 ifdef HAVE_WINSTORE
 	$(APPLY) $(SRC)/flac/console_write.patch
 	$(APPLY) $(SRC)/flac/remove_blocking_code_useless_flaclib.patch



More information about the vlc-commits mailing list