fix compilation on Windows
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 26 Nov 2010 17:05:16 +0000 (17:05 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 26 Nov 2010 17:05:16 +0000 (17:05 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@55021 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/efreet_cache.c
src/lib/efreet_desktop.c
src/lib/efreet_desktop_command.c
src/lib/efreet_icon.c
src/lib/efreet_icon_private.h [new file with mode: 0644]
src/lib/efreet_mime.c
src/lib/efreet_private.h
src/lib/efreet_trash.c
src/lib/efreet_utils.c

index 98edcd7..95b7d5b 100644 (file)
@@ -6,10 +6,13 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#include <Eet.h>
+#include <Ecore.h>
 #include <Ecore_File.h>
 
 #include "Efreet.h"
 #include "efreet_private.h"
+#include "efreet_icon_private.h"
 
 typedef struct _Efreet_Old_Cache Efreet_Old_Cache;
 
index 0aed558..2c7dd75 100644 (file)
@@ -26,8 +26,8 @@ void *alloca (size_t);
 #include <sys/mman.h>
 #include <fcntl.h>
 
-#ifdef _WIN32
-# include <winsock2.h>
+#ifdef HAVE_EVIL
+# include <Evil.h>
 #endif
 
 #include <Ecore_File.h>
@@ -133,6 +133,12 @@ efreet_desktop_init(void)
         return 0;
     }
 
+    if (!evil_sockets_init())
+      {
+         ERR("Could not initialize Winsock system");
+         return 0;
+      }
+
     efreet_desktop_cache = eina_hash_string_superfast_new(NULL);
     efreet_desktop_types = NULL;
 
@@ -168,6 +174,7 @@ efreet_desktop_shutdown(void)
     EINA_LIST_FREE(efreet_desktop_dirs, dir)
         eina_stringshare_del(dir);
     IF_FREE_HASH(change_monitors);
+    evil_sockets_shutdown();
     eina_log_domain_unregister(_efreet_desktop_log_dom);
 }
 
index 061a9b0..faaf283 100644 (file)
@@ -25,6 +25,10 @@ void *alloca (size_t);
 #include <limits.h>
 #include <ctype.h>
 
+#ifdef _WIN32
+# include <winsock2.h>
+#endif
+
 #include <Ecore_File.h>
 
 #include "Efreet.h"
index dc90c40..03994a4 100644 (file)
@@ -28,10 +28,12 @@ void *alloca (size_t);
 #include <dirent.h>
 #include <limits.h>
 
+#include <Eet.h>
 #include <Ecore_File.h>
 
 #include "Efreet.h"
 #include "efreet_private.h"
+#include "efreet_icon_private.h"
 
 #ifdef EFREET_MODULE_LOG_DOM
 #undef EFREET_MODULE_LOG_DOM
diff --git a/src/lib/efreet_icon_private.h b/src/lib/efreet_icon_private.h
new file mode 100644 (file)
index 0000000..ee42e0d
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef EFREET_ICON_PRIVATE_H\r
+#define EFREET_ICON_PRIVATE_H\r
+\r
+EAPI Eet_Data_Descriptor *efreet_desktop_edd_init(void);\r
+\r
+#endif\r
index 50e54a5..d8a6443 100644 (file)
@@ -734,7 +734,12 @@ efreet_mime_special_check(const char *file)
     struct stat s;
     int path_len = 0;
 
+    /* no link on Windows < Vista */
+#ifdef _WIN32
+    if (!stat(file, &s))
+#else
     if (!lstat(file, &s))
+#endif
     {
         if (S_ISREG(s.st_mode))
             return NULL;
@@ -775,7 +780,11 @@ efreet_mime_special_check(const char *file)
             /* Truncate to last slash */
             while (parent[--path_len] != '/') parent[path_len] = '\0';
 
+#ifdef _WIN32
+            if (!stat(file, &s2))
+#else
             if (!lstat(parent, &s2))
+#endif
             {
                 if (s.st_dev != s2.st_dev)
                     return _mime_inode_mountpoint;
index 2ba8a25..db031f0 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef EFREET_PRIVATE_H
 #define EFREET_PRIVATE_H
 
-#include <Eet.h>
-#include <Ecore.h>
-
 
 /**
  * @file efreet_private.h
@@ -211,8 +208,6 @@ size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]);
 
 const char *efreet_desktop_environment_get(void);
 
-EAPI Eet_Data_Descriptor *efreet_desktop_edd_init(void);
-
 void efreet_util_desktop_cache_reload(void);
 EAPI const char *efreet_desktop_util_cache_file(void);
 EAPI const char *efreet_desktop_cache_file(void);
index ab0ec21..a061383 100644 (file)
 static unsigned int _efreet_trash_init_count = 0;
 static const char *efreet_trash_dir = NULL;
 
+#ifdef _WIN32
+# define getuid() GetCurrentProcessId()
+#endif
+
 /* define macros and variable for using the eina logging system  */
 
 #ifdef EFREET_MODULE_LOG_DOM 
index 9888b4e..7895fa3 100644 (file)
@@ -27,6 +27,7 @@ void *alloca (size_t);
 #include <fnmatch.h>
 #include <limits.h>
 
+#include <Eet.h>
 #include <Ecore_File.h>
 
 #include "Efreet.h"