Changeset 1c3bc8974c3b0acf191be3e5ebaf4c00634411fa

Show
Ignore:
Timestamp:
02/12/07 18:30:36 (2 years ago)
Author:
Damien Fouilleul <damienf@videolan.org>
git-committer:
Damien Fouilleul <damienf@videolan.org> 1171301436 +0000
git-parent:

[057e689f92d55d9b3e5889a18e749b62f1fe3924]

git-author:
Damien Fouilleul <damienf@videolan.org> 1171301436 +0000
Message:

- src/vlc.c: compile fix for win32

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/vlc.c

    r042e6fa r1c3bc89  
    4040 
    4141#ifdef WIN32 
     42#include <windows.h> 
    4243extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron, 
    4344                           int expand_wildcards, int *startupinfo); 
     
    114115 
    115116        for( i = 1; i < i_wargc; i++ ) 
    116             ppsz_argv[i] = FromWide( wargv[i] ); 
     117        { 
     118            int len = WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, NULL, 0, NULL, NULL); 
     119            if( len > 0 ) 
     120            { 
     121                if( len > 1 ) { 
     122                    char *utf8arg = (char *)malloc(len); 
     123                    if( NULL != utf8arg ) 
     124                    { 
     125                        WideCharToMultiByte(CP_UTF8, 0, wargv[i], -1, utf8arg, len, NULL, NULL); 
     126                        ppsz_argv[i] = utf8arg; 
     127                    } 
     128                    else 
     129                    { 
     130                        /* failed!, quit */ 
     131                        return -1; 
     132                    } 
     133                } 
     134                else 
     135                { 
     136                    ppsz_argv[i] = ""; 
     137                } 
     138            } 
     139            else 
     140            { 
     141                /* failed!, quit */ 
     142                return -1; 
     143            } 
     144        } 
    117145    } 
    118146#endif