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)
downloadefl-6237e6f9bf44b4b989a928bc8f3fbcf341f58a42.tar.gz
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)
}
}
}
+#ifndef _MSC_VER
if (exe)
{
if (!lstat(exe, &st))
@@ -140,6 +141,7 @@ main(int argc, char **argv)
}
}
}
+#endif
if (we_are_elementary_run)
{
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,
ready--;
if (!fstat(itr->fd, &st))
{
+#ifndef _MSC_VER
if (S_ISSOCK(st.st_mode))
{
struct sockaddr_in peer;
@@ -149,6 +150,7 @@ _ecore_glib_context_poll_to(GPollFD *pfds,
&length))
itr->revents |= G_IO_ERR;
}
+#endif
}
}
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 @@
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
-#include <fnmatch.h>
+
+#ifndef _MSC_VER
+# include <unistd.h>
+#endif
+
+#ifdef _WIN32
+# include <evil_private.h>
+#endif
+
+#include <Eina.h>
#include <Ecore.h>
#include <Ecore_File.h>
@@ -747,9 +755,10 @@ efreet_mime_special_check(const char *file)
if (S_ISCHR(s.st_mode))
return _mime_inode_chardevice;
-
+#ifndef _MSC_VER
if (S_ISBLK(s.st_mode))
return _mime_inode_blockdevice;
+#endif
#ifndef _WIN32
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)
info->type = EINA_FILE_DIR;
else if (S_ISCHR(buf.st_mode))
info->type = EINA_FILE_CHR;
+#ifndef _MSC_VER
else if (S_ISBLK(buf.st_mode))
info->type = EINA_FILE_BLK;
+#endif
else if (S_ISFIFO(buf.st_mode))
info->type = EINA_FILE_FIFO;
+#ifndef _MSC_VER
else if (S_ISLNK(buf.st_mode))
info->type = EINA_FILE_LNK;
+#endif
+#ifndef _MSC_VER
else if (S_ISSOCK(buf.st_mode))
info->type = EINA_FILE_SOCK;
+#endif
else
info->type = EINA_FILE_UNKNOWN;
}
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 *
return EINA_FILE_DIR;
else if (S_ISCHR(st->mode))
return EINA_FILE_CHR;
+#ifndef _MSC_VER
else if (S_ISBLK(st->mode))
return EINA_FILE_BLK;
+#endif
else if (S_ISFIFO(st->mode))
return EINA_FILE_FIFO;
#ifndef _WIN32