[vlc-commits] Freetype/Dwrite: use GetSystemDefaultLocaleName when on Vista+
Jean-Baptiste Kempf
git at videolan.org
Fri May 18 16:14:34 CEST 2018
vlc/vlc-3.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri May 18 16:14:07 2018 +0200| [9ab5efedb715ccc2aafbe07a8786f2e2b0bd137b] | committer: Jean-Baptiste Kempf
Freetype/Dwrite: use GetSystemDefaultLocaleName when on Vista+
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9ab5efedb715ccc2aafbe07a8786f2e2b0bd137b
---
modules/text_renderer/freetype/fonts/dwrite.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/text_renderer/freetype/fonts/dwrite.cpp b/modules/text_renderer/freetype/fonts/dwrite.cpp
index c3dbde56b2..a30c535a01 100644
--- a/modules/text_renderer/freetype/fonts/dwrite.cpp
+++ b/modules/text_renderer/freetype/fonts/dwrite.cpp
@@ -359,6 +359,7 @@ static bool DWrite_PartialMatch( filter_t *p_filter, ComPtr< IDWriteLocalizedStr
wchar_t buff_sys[ LOCALE_NAME_MAX_LENGTH ] = {};
wchar_t buff_usr[ LOCALE_NAME_MAX_LENGTH ] = {};
+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
HMODULE h_dll = GetModuleHandle(_T("kernel32.dll"));
typedef int ( WINAPI *GetUserDefaultLocaleName )( LPWSTR lpLocaleName, int cchLocaleName );
@@ -373,6 +374,10 @@ static bool DWrite_PartialMatch( filter_t *p_filter, ComPtr< IDWriteLocalizedStr
OurGetSystemDefaultLocaleName( buff_sys, LOCALE_NAME_MAX_LENGTH );
if( OurGetUserDefaultLocaleName )
OurGetUserDefaultLocaleName( buff_usr, LOCALE_NAME_MAX_LENGTH );
+#else
+ GetSystemDefaultLocaleName( buff_sys, LOCALE_NAME_MAX_LENGTH );
+ GetUserDefaultLocaleName( buff_usr, LOCALE_NAME_MAX_LENGTH );
+#endif
const wchar_t *pp_locales[] = { L"en-US", buff_sys, buff_usr };
More information about the vlc-commits
mailing list