Commit 4f5b5ee9 authored by Damien Fouilleul's avatar Damien Fouilleul

- since DIR* on win32 is mapped to a private data type, rewinddir(), seekdir()...

- since DIR* on win32 is mapped to a private data type, rewinddir(), seekdir() and telldir() must also be mapped to their vlc_ equivalent. Should fix ticket #926
parent 9ed73544
...@@ -958,9 +958,15 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw ) ...@@ -958,9 +958,15 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
# define opendir vlc_opendir # define opendir vlc_opendir
# define readdir vlc_readdir # define readdir vlc_readdir
# define closedir vlc_closedir # define closedir vlc_closedir
# define rewinddir vlc_rewindir
# define seekdir vlc_seekdir
# define telldir vlc_telldir
VLC_EXPORT( void *, vlc_opendir, ( const char * ) ); VLC_EXPORT( void *, vlc_opendir, ( const char * ) );
VLC_EXPORT( void *, vlc_readdir, ( void * ) ); VLC_EXPORT( void *, vlc_readdir, ( void * ) );
VLC_EXPORT( int, vlc_closedir, ( void * ) ); VLC_EXPORT( int, vlc_closedir, ( void * ) );
VLC_INTERNAL( void, vlc_rewinddir, ( void * ) );
VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
VLC_INTERNAL( long, vlc_telldir, ( void * ) );
#else #else
struct dirent; /* forward declaration for vlc_symbols.h */ struct dirent; /* forward declaration for vlc_symbols.h */
# if !defined(__PLUGIN__) # if !defined(__PLUGIN__)
...@@ -975,12 +981,17 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw ) ...@@ -975,12 +981,17 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
VLC_INTERNAL( void *, vlc_wopendir, ( const wchar_t * ) ); VLC_INTERNAL( void *, vlc_wopendir, ( const wchar_t * ) );
VLC_INTERNAL( struct _wdirent *, vlc_wreaddir, ( void * ) ); VLC_INTERNAL( struct _wdirent *, vlc_wreaddir, ( void * ) );
VLC_INTERNAL( int, vlc_wclosedir, ( void * ) ); VLC_INTERNAL( int, vlc_wclosedir, ( void * ) );
VLC_INTERNAL( void, vlc_rewinddir, ( void * ) );
VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
VLC_INTERNAL( long, vlc_telldir, ( void * ) );
# define opendir Use_utf8_opendir_or_vlc_wopendir_instead! # define opendir Use_utf8_opendir_or_vlc_wopendir_instead!
# define readdir Use_utf8_readdir_or_vlc_wreaddir_instead! # define readdir Use_utf8_readdir_or_vlc_wreaddir_instead!
# define closedir vlc_wclosedir # define closedir vlc_wclosedir
# define _wopendir vlc_wopendir # define _wopendir vlc_wopendir
# define _wreaddir vlc_wreaddir # define _wreaddir vlc_wreaddir
# define _wclosedir vlc_wclosedir # define rewinddir vlc_rewinddir
# define seekdir vlc_seekdir
# define telldir vlc_telldir
#endif #endif
/* Format type specifiers for 64 bits numbers */ /* Format type specifiers for 64 bits numbers */
......
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
# undef _wopendir # undef _wopendir
# undef _wreaddir # undef _wreaddir
# undef _wclosedir # undef _wclosedir
# undef rewinddir
# undef seekdir
# undef telldir
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
#endif #endif
...@@ -483,6 +486,31 @@ int vlc_wclosedir( void *_p_dir ) ...@@ -483,6 +486,31 @@ int vlc_wclosedir( void *_p_dir )
free( p_dir ); free( p_dir );
return i_ret; return i_ret;
} }
void vlc_rewinddir( void *_p_dir )
{
vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
if ( p_dir->p_real_dir != NULL )
_wrewinddir( p_dir->p_real_dir );
}
void vlc_seekdir( void *_p_dir, long loc)
{
vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
if ( p_dir->p_real_dir != NULL )
_wseekdir( p_dir->p_real_dir, loc );
}
long vlc_telldir( void *_p_dir )
{
vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
if ( p_dir->p_real_dir != NULL )
return _wtelldir( p_dir->p_real_dir );
return 0;
}
#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