]> git.sesse.net Git - vlc/commitdiff
- access/file.c: fixed stat on win32, make sure the right stat structure is used...
authorDamien Fouilleul <damienf@videolan.org>
Sat, 11 Nov 2006 19:14:53 +0000 (19:14 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Sat, 11 Nov 2006 19:14:53 +0000 (19:14 +0000)
modules/access/file.c

index 58aecfb8e91f46690c18b6f51d7691771bc91c69..3a621f8d31d55c5610f661dc3c0ffe2f45f5ffa5 100644 (file)
@@ -53,6 +53,7 @@
 #if defined( WIN32 ) && !defined( UNDER_CE )
 /* fstat() support for large files on win32 */
 #   define fstat(a,b) _fstati64(a,b)
+#   define FILESTAT _stati64 
 #   ifdef lseek
 #      undef lseek
 #   endif
@@ -67,6 +68,8 @@
 #      undef lseek
 #   endif
 #   define lseek fseek
+#else
+#   define FILESTAT stat
 #endif
 
 #include "charset.h"
@@ -166,7 +169,7 @@ static int Open( vlc_object_t *p_this )
         fd = open_file (p_access, p_access->psz_path);
 
 #ifdef HAVE_SYS_STAT_H
-    struct stat st;
+    struct FILESTAT st;
 
     while (fd != -1)
     {
@@ -299,7 +302,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
     if( p_access->info.i_size != 0 &&
         (p_sys->i_nb_reads % INPUT_FSTAT_NB_READS) == 0 )
     {
-        struct stat st;
+        struct FILESTAT st;
 
         if ((fstat (fd, &st) == 0)
          && (p_access->info.i_size != st.st_size))