[vlc-commits] contrib: libass: don't use tchar for opendir
Steve Lhomme
git at videolan.org
Tue Mar 19 12:10:30 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 19 12:09:52 2019 +0100| [17554c9d36548c3ee64a70880a08ffedebee323b] | committer: Steve Lhomme
contrib: libass: don't use tchar for opendir
Since it always assumes it outputs unicode strings even though _UNICODE is not
defined.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=17554c9d36548c3ee64a70880a08ffedebee323b
---
contrib/src/ass/libass-no-tchar.patch | 34 ++++++++++++++++++++++++++++++++++
contrib/src/ass/rules.mak | 1 +
2 files changed, 35 insertions(+)
diff --git a/contrib/src/ass/libass-no-tchar.patch b/contrib/src/ass/libass-no-tchar.patch
new file mode 100644
index 0000000000..12a6681e95
--- /dev/null
+++ b/contrib/src/ass/libass-no-tchar.patch
@@ -0,0 +1,34 @@
+--- libass/libass/ass_fontselect.c.tchar 2019-03-19 12:07:15.464633200 +0100
++++ libass/libass/ass_fontselect.c 2019-03-19 12:06:48.404627300 +0100
+@@ -48,7 +48,6 @@
+ #include "ass_string.h"
+
+ #include <windows.h>
+-#include <tchar.h>
+
+ #define ABS(x) ((x) < 0 ? -(x) : (x))
+ #define MAX_FULLNAME 100
+@@ -195,12 +194,12 @@ static inline wchar_t *ToWide (const cha
+ static void load_fonts_from_dir(ASS_Library *library, const char *dir)
+ {
+ wchar_t *dirw = ToWide(dir);
+- _TDIR *d = _topendir(dirw);
++ _WDIR *d = _wopendir(dirw);
+ free(dirw);
+ if (!d)
+ return;
+ while (1) {
+- struct _tdirent *entry = _treaddir(d);
++ struct _wdirent *entry = _wreaddir(d);
+ if (!entry)
+ break;
+ char* d_name = FromWide(entry->d_name);
+@@ -220,7 +219,7 @@ static void load_fonts_from_dir(ASS_Libr
+ }
+ free(d_name);
+ }
+- _tclosedir(d);
++ _wclosedir(d);
+ }
+
+ /**
diff --git a/contrib/src/ass/rules.mak b/contrib/src/ass/rules.mak
index 5ba7f11668..5029002ab6 100644
--- a/contrib/src/ass/rules.mak
+++ b/contrib/src/ass/rules.mak
@@ -50,6 +50,7 @@ libass: libass-$(ASS_VERSION).tar.gz .sum-ass
$(APPLY) $(SRC)/ass/ass-macosx.patch
ifdef HAVE_WIN32
$(APPLY) $(SRC)/ass/use-topendir.patch
+ $(APPLY) $(SRC)/ass/libass-no-tchar.patch
ifdef HAVE_WINSTORE
$(APPLY) $(SRC)/ass/dwrite.patch
endif
More information about the vlc-commits
mailing list