[vlc-commits] commit: Win32: fix closedir() to match vlc_opendir() ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Wed Nov 3 19:38:14 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov  3 20:36:03 2010 +0200| [358998994e25ce482130d6c1b281c543a59caae3] | committer: Rémi Denis-Courmont 

Win32: fix closedir() to match vlc_opendir()

Parental advisory: explicit kludge.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=358998994e25ce482130d6c1b281c543a59caae3
---

 include/vlc_fs.h |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/vlc_fs.h b/include/vlc_fs.h
index 1210683..825f3a6 100644
--- a/include/vlc_fs.h
+++ b/include/vlc_fs.h
@@ -44,8 +44,18 @@ VLC_EXPORT( int, vlc_mkdir, ( const char *filename, mode_t mode ) );
 VLC_EXPORT( int, vlc_unlink, ( const char *filename ) );
 VLC_EXPORT( int, vlc_rename, ( const char *oldpath, const char *newpath ) );
 
-#if defined( WIN32 ) && !defined( UNDER_CE )
-# define stat _stati64
+#if defined( WIN32 )
+# ifndef UNDER_CE
+#  define stat _stati64
+# endif
+static inline int vlc_closedir( DIR *dir )
+{
+    _WDIR *wdir = *(_WDIR **)dir;
+    free( dir );
+    return wdir ? _wclosedir( wdir ) : 0;
+}
+# undef closedir
+# define closedir vlc_closedir
 #endif
 
 VLC_EXPORT( int, vlc_stat, ( const char *filename, struct stat *buf ) );



More information about the vlc-commits mailing list