summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 20:05:57 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 22:11:45 -0300
commitcb1b57ec6a51faf029b1441713e2b357585436f0 (patch)
tree4a6bf71a994b06b94c586e9dc8756645ddd6ee3e
parent9669af729814560b1773a9c58f8db4d811db917c (diff)
windows: Fix use of S_ISREG and S_ISDIR in windows code
-rw-r--r--src/lib/eina/eina_file_win32.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c
index 99327ee426..2f2cdc597e 100644
--- a/src/lib/eina/eina_file_win32.c
+++ b/src/lib/eina/eina_file_win32.c
@@ -1036,7 +1036,7 @@ eina_file_statat(void *container EINA_UNUSED, Eina_File_Direct_Info *info, Eina_
1036 EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1); 1036 EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1);
1037 EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1); 1037 EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1);
1038 1038
1039 if (stat64(info->path, &buf)) 1039 if (_stat64(info->path, &buf))
1040 { 1040 {
1041 info->type = EINA_FILE_UNKNOWN; 1041 info->type = EINA_FILE_UNKNOWN;
1042 return -1; 1042 return -1;
@@ -1044,9 +1044,12 @@ eina_file_statat(void *container EINA_UNUSED, Eina_File_Direct_Info *info, Eina_
1044 1044
1045 if (info->type == EINA_FILE_UNKNOWN) 1045 if (info->type == EINA_FILE_UNKNOWN)
1046 { 1046 {
1047 if (S_ISREG(buf.st_mode)) 1047#define EINA_S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
1048#define EINA_S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
1049
1050 if (EINA_S_ISREG(buf.st_mode))
1048 info->type = EINA_FILE_REG; 1051 info->type = EINA_FILE_REG;
1049 else if (S_ISDIR(buf.st_mode)) 1052 else if (EINA_S_ISDIR(buf.st_mode))
1050 info->type = EINA_FILE_DIR; 1053 info->type = EINA_FILE_DIR;
1051 else 1054 else
1052 info->type = EINA_FILE_UNKNOWN; 1055 info->type = EINA_FILE_UNKNOWN;