Commit e5d458a7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

win32: fix IDN support when building retardedly

parent 281252c2
......@@ -832,6 +832,30 @@ char *vlc_uri_fixup(const char *str)
#elif defined (_WIN32)
# include <windows.h>
# include <vlc_charset.h>
# if (_WIN32_WINNT < _WIN32_WINNT_VISTA)
# define IDN_ALLOW_UNASSIGNED 0x01
static int IdnToAscii(DWORD flags, LPCWSTR str, int len, LPWSTR buf, int size)
{
HMODULE h = LoadLibrary(_T("Normaliz.dll"));
if (h == NULL)
{
errno = ENOSYS;
return 0;
}
int WINAPI (*IdnToAsciiReal)(DWORD, LPCWSTR, int, LPWSTR, int);
int ret = 0;
IdnToAsciiReal = GetProcAddress(h, "IdnToAscii");
if (IdnToAsciiReal != NULL)
ret = IdnToAsciiReal(flags, str, len, buf, size);
else
errno = ENOSYS;
FreeLibrary(h);
return ret;
}
# endif
#endif
/**
......@@ -859,7 +883,7 @@ static char *vlc_idna_to_ascii (const char *idn)
return NULL;
}
#elif defined (_WIN32) && (_WIN32_WINNT >= 0x0601)
#elif defined (_WIN32)
char *ret = NULL;
if (idn[0] == '\0')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment