[vlc-commits] contribs: apply newlocale patch

Thomas Guillem git at videolan.org
Thu Nov 16 21:11:15 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Nov 16 21:09:38 2017 +0100| [1f6f53398888d2c24c8606f05592c2d85b03eb64] | committer: Thomas Guillem

contribs: apply newlocale patch

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

 ...licitly-set-a-category-mask-for-newlocale.patch | 32 ++++++++++++++++++++++
 contrib/src/libplacebo/rules.mak                   |  1 +
 2 files changed, 33 insertions(+)

diff --git a/contrib/src/libplacebo/0003-osdep-explicitly-set-a-category-mask-for-newlocale.patch b/contrib/src/libplacebo/0003-osdep-explicitly-set-a-category-mask-for-newlocale.patch
new file mode 100644
index 0000000000..c855a7c3ae
--- /dev/null
+++ b/contrib/src/libplacebo/0003-osdep-explicitly-set-a-category-mask-for-newlocale.patch
@@ -0,0 +1,32 @@
+From e0a1db693f38eb40437b1aaa81a72848ce02210b Mon Sep 17 00:00:00 2001
+From: ePirat <epirat07 at gmail.com>
+Date: Thu, 16 Nov 2017 03:53:40 +0100
+Subject: [PATCH 3/3] osdep: explicitly set a category mask for newlocale
+
+While on Linux it works fine to not specify one, as Linux will fill all
+not given ones from the POSIX locale, on BSD using `xlocale.h` this does
+not work.
+
+When no base locale is given, BSD uses the current locale and fills not
+matching bitmasks with values from that one, not with values from the
+POSIX locale.
+---
+ src/osdep/printf_useloc_posix.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/osdep/printf_useloc_posix.c b/src/osdep/printf_useloc_posix.c
+index 9bb1812..7ddc01f 100644
+--- a/src/osdep/printf_useloc_posix.c
++++ b/src/osdep/printf_useloc_posix.c
+@@ -31,7 +31,7 @@ static locale_t cloc;
+ 
+ void printf_c_init()
+ {
+-    cloc = newlocale(0, "C", (locale_t) 0);
++    cloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
+     if (!cloc)
+         abort();
+ }
+-- 
+2.11.0
+
diff --git a/contrib/src/libplacebo/rules.mak b/contrib/src/libplacebo/rules.mak
index 89fe4728fd..f9dcaf2dc4 100644
--- a/contrib/src/libplacebo/rules.mak
+++ b/contrib/src/libplacebo/rules.mak
@@ -28,6 +28,7 @@ libplacebo: $(PLACEBO_ARCHIVE) .sum-libplacebo
 ifdef HAVE_WIN32
 	$(APPLY) $(SRC)/libplacebo/0002-build-fix-win32-build.patch
 endif
+	$(APPLY) $(SRC)/libplacebo/0003-osdep-explicitly-set-a-category-mask-for-newlocale.patch
 	$(MOVE)
 
 .libplacebo: libplacebo



More information about the vlc-commits mailing list