summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Antônio Cardoso <joao.maker@gmail.com>2020-07-31 08:23:49 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 16:10:26 -0300
commit6237e6f9bf44b4b989a928bc8f3fbcf341f58a42 (patch)
tree27c458d650abf4828e143e57c79ea2480350dbfd
parent39c77ec5909e9698436ad45295e32cb62536dc70 (diff)
win32: Fix IF_S* macros
Since S_IFBLK, S_IFSOCK and S_IFLNK are not defined by ucrt because they make no sense for windows, we can just remove those definitions from efl sources when compiling for windows.
-rw-r--r--src/bin/elementary/run.c2
-rw-r--r--src/lib/ecore/ecore_glib.c2
-rw-r--r--src/lib/efreet/efreet_mime.c15
-rw-r--r--src/lib/eina/eina_file.c6
-rw-r--r--src/lib/eio/efl_io_model.c2
5 files changed, 24 insertions, 3 deletions
diff --git a/src/bin/elementary/run.c b/src/bin/elementary/run.c
index 261935f41f..b1aaf9f0e4 100644
--- a/src/bin/elementary/run.c
+++ b/src/bin/elementary/run.c
@@ -118,6 +118,7 @@ main(int argc, char **argv)
118 } 118 }
119 } 119 }
120 } 120 }
121#ifndef _MSC_VER
121 if (exe) 122 if (exe)
122 { 123 {
123 if (!lstat(exe, &st)) 124 if (!lstat(exe, &st))
@@ -140,6 +141,7 @@ main(int argc, char **argv)
140 } 141 }
141 } 142 }
142 } 143 }
144#endif
143 if (we_are_elementary_run) 145 if (we_are_elementary_run)
144 { 146 {
145 sargc = argc; 147 sargc = argc;
diff --git a/src/lib/ecore/ecore_glib.c b/src/lib/ecore/ecore_glib.c
index a914f1b3ec..e21c486739 100644
--- a/src/lib/ecore/ecore_glib.c
+++ b/src/lib/ecore/ecore_glib.c
@@ -139,6 +139,7 @@ _ecore_glib_context_poll_to(GPollFD *pfds,
139 ready--; 139 ready--;
140 if (!fstat(itr->fd, &st)) 140 if (!fstat(itr->fd, &st))
141 { 141 {
142#ifndef _MSC_VER
142 if (S_ISSOCK(st.st_mode)) 143 if (S_ISSOCK(st.st_mode))
143 { 144 {
144 struct sockaddr_in peer; 145 struct sockaddr_in peer;
@@ -149,6 +150,7 @@ _ecore_glib_context_poll_to(GPollFD *pfds,
149 &length)) 150 &length))
150 itr->revents |= G_IO_ERR; 151 itr->revents |= G_IO_ERR;
151 } 152 }
153#endif
152 } 154 }
153 } 155 }
154 if (FD_ISSET(itr->fd, efds) && (itr->events & (G_IO_HUP | G_IO_ERR))) 156 if (FD_ISSET(itr->fd, efds) && (itr->events & (G_IO_HUP | G_IO_ERR)))
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index d34da27192..076bb4ba26 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -5,8 +5,16 @@
5#include <ctype.h> 5#include <ctype.h>
6#include <sys/stat.h> 6#include <sys/stat.h>
7#include <fcntl.h> 7#include <fcntl.h>
8#include <unistd.h> 8
9#include <fnmatch.h> 9#ifndef _MSC_VER
10# include <unistd.h>
11#endif
12
13#ifdef _WIN32
14# include <evil_private.h>
15#endif
16
17#include <Eina.h>
10 18
11#include <Ecore.h> 19#include <Ecore.h>
12#include <Ecore_File.h> 20#include <Ecore_File.h>
@@ -747,9 +755,10 @@ efreet_mime_special_check(const char *file)
747 755
748 if (S_ISCHR(s.st_mode)) 756 if (S_ISCHR(s.st_mode))
749 return _mime_inode_chardevice; 757 return _mime_inode_chardevice;
750 758#ifndef _MSC_VER
751 if (S_ISBLK(s.st_mode)) 759 if (S_ISBLK(s.st_mode))
752 return _mime_inode_blockdevice; 760 return _mime_inode_blockdevice;
761#endif
753 762
754#ifndef _WIN32 763#ifndef _WIN32
755 if (S_ISSOCK(s.st_mode)) 764 if (S_ISSOCK(s.st_mode))
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index 2cb7dceebf..98041da657 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -1221,14 +1221,20 @@ eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *st)
1221 info->type = EINA_FILE_DIR; 1221 info->type = EINA_FILE_DIR;
1222 else if (S_ISCHR(buf.st_mode)) 1222 else if (S_ISCHR(buf.st_mode))
1223 info->type = EINA_FILE_CHR; 1223 info->type = EINA_FILE_CHR;
1224#ifndef _MSC_VER
1224 else if (S_ISBLK(buf.st_mode)) 1225 else if (S_ISBLK(buf.st_mode))
1225 info->type = EINA_FILE_BLK; 1226 info->type = EINA_FILE_BLK;
1227#endif
1226 else if (S_ISFIFO(buf.st_mode)) 1228 else if (S_ISFIFO(buf.st_mode))
1227 info->type = EINA_FILE_FIFO; 1229 info->type = EINA_FILE_FIFO;
1230#ifndef _MSC_VER
1228 else if (S_ISLNK(buf.st_mode)) 1231 else if (S_ISLNK(buf.st_mode))
1229 info->type = EINA_FILE_LNK; 1232 info->type = EINA_FILE_LNK;
1233#endif
1234#ifndef _MSC_VER
1230 else if (S_ISSOCK(buf.st_mode)) 1235 else if (S_ISSOCK(buf.st_mode))
1231 info->type = EINA_FILE_SOCK; 1236 info->type = EINA_FILE_SOCK;
1237#endif
1232 else 1238 else
1233 info->type = EINA_FILE_UNKNOWN; 1239 info->type = EINA_FILE_UNKNOWN;
1234 } 1240 }
diff --git a/src/lib/eio/efl_io_model.c b/src/lib/eio/efl_io_model.c
index 88c32b19b8..3da0e7a4bc 100644
--- a/src/lib/eio/efl_io_model.c
+++ b/src/lib/eio/efl_io_model.c
@@ -277,8 +277,10 @@ _efl_io_model_info_type_get(const Eina_File_Direct_Info *info, const Eina_Stat *
277 return EINA_FILE_DIR; 277 return EINA_FILE_DIR;
278 else if (S_ISCHR(st->mode)) 278 else if (S_ISCHR(st->mode))
279 return EINA_FILE_CHR; 279 return EINA_FILE_CHR;
280#ifndef _MSC_VER
280 else if (S_ISBLK(st->mode)) 281 else if (S_ISBLK(st->mode))
281 return EINA_FILE_BLK; 282 return EINA_FILE_BLK;
283#endif
282 else if (S_ISFIFO(st->mode)) 284 else if (S_ISFIFO(st->mode))
283 return EINA_FILE_FIFO; 285 return EINA_FILE_FIFO;
284#ifndef _WIN32 286#ifndef _WIN32