Commit 1c3bc897 authored by Damien Fouilleul's avatar Damien Fouilleul

- src/vlc.c: compile fix for win32

parent 057e689f
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#ifdef WIN32 #ifdef WIN32
#include <windows.h>
extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron, extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron,
int expand_wildcards, int *startupinfo); int expand_wildcards, int *startupinfo);
#endif #endif
...@@ -113,7 +114,34 @@ int main( int i_argc, char *ppsz_argv[] ) ...@@ -113,7 +114,34 @@ int main( int i_argc, char *ppsz_argv[] )
__wgetmainargs(&i_wargc, &wargv, &wenvp, 0, &si); __wgetmainargs(&i_wargc, &wargv, &wenvp, 0, &si);
for( i = 1; i < i_wargc; i++ ) for( i = 1; i < i_wargc; i++ )
ppsz_argv[i] = FromWide( wargv[i] ); {
int len = WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, NULL, 0, NULL, NULL);
if( len > 0 )
{
if( len > 1 ) {
char *utf8arg = (char *)malloc(len);
if( NULL != utf8arg )
{
WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, utf8arg, len, NULL, NULL);
ppsz_argv[i] = utf8arg;
}
else
{
/* failed!, quit */
return -1;
}
}
else
{
ppsz_argv[i] = "";
}
}
else
{
/* failed!, quit */
return -1;
}
}
} }
#endif #endif
......
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