fix compilation on Windows

SVN revision: 55021
This commit is contained in:
Vincent Torri 2010-11-26 17:05:16 +00:00
parent 756df73df7
commit 126c3574c3
9 changed files with 38 additions and 7 deletions

View 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;

View 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);
}

View 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"

View 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

View File

@ -0,0 +1,6 @@
#ifndef EFREET_ICON_PRIVATE_H
#define EFREET_ICON_PRIVATE_H
EAPI Eet_Data_Descriptor *efreet_desktop_edd_init(void);
#endif

View 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;

View 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);

View File

@ -20,6 +20,10 @@
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

View 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"