From: Rafaël Carré Date: Tue, 21 Nov 2006 06:26:41 +0000 (+0000) Subject: Use non wide char functions on windows 9x X-Git-Tag: 0.9.0-test0~9347 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=3d1a131f61ce2c52997128178a55f708e10ca793;p=vlc Use non wide char functions on windows 9x --- diff --git a/src/extras/libc.c b/src/extras/libc.c index c56ea10d0d..4dfe95835c 100644 --- a/src/extras/libc.c +++ b/src/extras/libc.c @@ -426,6 +426,10 @@ void *vlc_opendir_wrapper( const char *psz_path ) wpath[MAX_PATH] = L'\0'; p_real_dir = _wopendir( wpath ); } + else + { + p_real_dir = opendir( psz_path ); + } if ( p_real_dir == NULL ) return NULL; @@ -454,8 +458,11 @@ struct dirent *vlc_readdir_wrapper( void *_p_dir ) p_dir->b_insert_back = VLC_FALSE; return &p_dir->dd_dir; } - - return _wreaddir( p_dir->p_real_dir ); + + if( GetVersion() < 0x80000000 ) + return _wreaddir( p_dir->p_real_dir ); + else + return readdir( p_dir->p_real_dir ); } /* Drive letters mode */ @@ -481,7 +488,11 @@ int vlc_closedir_wrapper( void *_p_dir ) if ( p_dir->p_real_dir != NULL ) { - int i_ret = _wclosedir( p_dir->p_real_dir ); + int i_ret; + if( GetVersion() < 0x80000000 ) + i_ret = _wclosedir( p_dir->p_real_dir ); + else + i_ret = closedir( p_dir->p_real_dir ); free( p_dir ); return i_ret; }