eio: fix correct stat structure on Windows 32 bits
authorVincent Torri <vincent.torri@gmail.com>
Mon, 14 Aug 2017 13:50:03 +0000 (15:50 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 14 Aug 2017 17:17:24 +0000 (10:17 -0700)
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/eio/eio_private.h
src/lib/eio/eio_single.c

index f1466b6..a81d94f 100644 (file)
 #include "Eio.h"
 
 #ifdef _WIN32
+# ifdef _WIN64
 typedef struct __stat64 _eio_stat_t;
-#define _eio_stat(p, b) _stat64(p, b)
-#define _eio_lstat(p, b) _stat64(p, b)
+#  define _eio_stat(p, b) _stat64(p, b)
+#  define _eio_lstat(p, b) _stat64(p, b)
+# else
+typedef struct _stat _eio_stat_t;
+#  define _eio_stat(p, b) _stat(p, b)
+#  define _eio_lstat(p, b) _stat(p, b)
+# endif
 #else
 typedef struct stat _eio_stat_t;
-#define _eio_stat(p, b) stat(p, b)
-#define _eio_lstat(p, b) lstat(p, b)
+# define _eio_stat(p, b) stat(p, b)
+# define _eio_lstat(p, b) lstat(p, b)
 
 # include <grp.h>
 # include <pwd.h>
index b2a7a49..fb8e826 100644 (file)
@@ -155,7 +155,7 @@ static void
 _eio_file_lstat(void *data, Ecore_Thread *thread)
 {
    Eio_File_Stat *s = data;
-   struct stat buf;
+   _eio_stat_t buf;
 
    if (_eio_lstat(s->path, &buf) != 0)
      eio_file_thread_error(&s->common, thread);