From 6237e6f9bf44b4b989a928bc8f3fbcf341f58a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Fri, 31 Jul 2020 08:23:49 -0300 Subject: 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. --- src/bin/elementary/run.c | 2 ++ src/lib/ecore/ecore_glib.c | 2 ++ src/lib/efreet/efreet_mime.c | 15 ++++++++++++--- src/lib/eina/eina_file.c | 6 ++++++ src/lib/eio/efl_io_model.c | 2 ++ 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 #include #include -#include -#include + +#ifndef _MSC_VER +# include +#endif + +#ifdef _WIN32 +# include +#endif + +#include #include #include @@ -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 -- cgit v1.2.1