]> git.sesse.net Git - vlc/blobdiff - modules/access/file.c
Use _WIN32 rather than WIN32 (same for WIN64)
[vlc] / modules / access / file.c
index 37c1a2bbe3a7ff9e9bd0eb883e6bc7ee002d59d1..8e00b3d94f0bf1aede33334ff5e359d9259e7f35 100644 (file)
@@ -44,7 +44,7 @@
 #   include <linux/magic.h>
 #endif
 
-#if defined( WIN32 )
+#if defined( _WIN32 )
 #   include <io.h>
 #   include <ctype.h>
 #   include <shlwapi.h>
@@ -58,7 +58,7 @@
 #include <vlc_input.h>
 #include <vlc_access.h>
 #include <vlc_dialog.h>
-#ifdef WIN32
+#ifdef _WIN32
 # include <vlc_charset.h>
 #endif
 #include <vlc_fs.h>
 
 struct access_sys_t
 {
-    unsigned int i_nb_reads;
-
     int fd;
 
     /* */
     bool b_pace_control;
 };
 
-#if !defined (WIN32) && !defined (__OS2__)
+#if !defined (_WIN32) && !defined (__OS2__)
 static bool IsRemote (int fd)
 {
 #if defined (HAVE_FSTATVFS) && defined (MNT_LOCAL)
@@ -111,10 +109,10 @@ static bool IsRemote (int fd)
 }
 # define IsRemote(fd,path) IsRemote(fd)
 
-#else /* WIN32 || __OS2__ */
+#else /* _WIN32 || __OS2__ */
 static bool IsRemote (const char *path)
 {
-# if !defined(__OS2__)
+# if !defined(__OS2__) && !VLC_WINSTORE_APP
     wchar_t *wpath = ToWide (path);
     bool is_remote = (wpath != NULL && PathIsNetworkPathW (wpath));
     free (wpath);
@@ -222,7 +220,6 @@ int FileOpen( vlc_object_t *p_this )
     p_access->pf_block = NULL;
     p_access->pf_control = FileControl;
     p_access->p_sys = p_sys;
-    p_sys->i_nb_reads = 0;
     p_sys->fd = fd;
 
     if (S_ISREG (st.st_mode) || S_ISBLK (st.st_mode))
@@ -305,11 +302,7 @@ static ssize_t FileRead (access_t *p_access, uint8_t *p_buffer, size_t i_len)
 
     p_access->info.i_pos += val;
     p_access->info.b_eof = !val;
-
-    p_sys->i_nb_reads++;
-
-    if (!(p_sys->i_nb_reads % INPUT_FSTAT_NB_READS)
-     || (p_access->info.i_pos > p_access->info.i_size))
+    if (p_access->info.i_pos >= p_access->info.i_size)
     {
         struct stat st;
 
@@ -340,7 +333,7 @@ static ssize_t StreamRead (access_t *p_access, uint8_t *p_buffer, size_t i_len)
     access_sys_t *p_sys = p_access->p_sys;
     int fd = p_sys->fd;
 
-#if !defined (WIN32) && !defined (__OS2__)
+#if !defined (_WIN32) && !defined (__OS2__)
     ssize_t val = net_Read (p_access, fd, NULL, p_buffer, i_len, false);
 #else
     ssize_t val = read (fd, p_buffer, i_len);