* undef close() and open() in evas_module also for mingw

* init Evil in eina as it uses fcntl() with the winsock2 library
 * fix compilation of evas_cache_image.c with mingw
 * formatting


SVN revision: 45724
This commit is contained in:
Vincent Torri 2010-01-30 00:09:29 +00:00
parent 7a09cb73a6
commit 20d5a675db
4 changed files with 27 additions and 3 deletions

View File

@ -786,10 +786,18 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *
return im;
on_stat_error:
#ifndef _WIN32
if ((errno == ENOENT) || (errno == ENOTDIR) ||
(errno == ENAMETOOLONG) || (errno == ELOOP))
#else
if (errno == ENOENT)
#endif
*error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
#ifndef _WIN32
else if ((errno == ENOMEM) || (errno == EOVERFLOW))
#else
else if (errno == ENOMEM)
#endif
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
else if (errno == EACCES)
*error = EVAS_LOAD_ERROR_PERMISSION_DENIED;

View File

@ -21,13 +21,18 @@ evas_init(void)
if (++_evas_init_count != 1)
return _evas_init_count;
if (!eina_init())
#ifdef HAVE_EVIL
if (!evil_init())
return --_evas_init_count;
#endif
if (!eina_init())
goto shutdown_evil;
_evas_log_dom_global = eina_log_domain_register("evas_main",EVAS_DEFAULT_LOG_COLOR);
if (_evas_log_dom_global < 0)
{
EINA_LOG_ERR("Evas could not create a default log domain\n");
EINA_LOG_ERR("Evas could not create a default log domain\n");
goto shutdown_eina;
}
@ -52,6 +57,10 @@ evas_init(void)
#endif
shutdown_eina:
eina_shutdown();
shutdown_evil:
#ifdef HAVE_EVIL
evil_shutdown();
#endif
return --_evas_init_count;
}
@ -88,6 +97,9 @@ evas_shutdown(void)
evas_module_shutdown();
eina_log_domain_unregister(_evas_log_dom_global);
eina_shutdown();
#ifdef HAVE_EVIL
evil_shutdown();
#endif
return _evas_init_count;
}

View File

@ -8,7 +8,7 @@
#include <evas_private.h>
#include <evas_module.h>
#ifdef _MSC_VER
#ifdef _WIN32
# ifdef open
# undef open
# endif

View File

@ -9,6 +9,10 @@
# include "config.h" /* so that EAPI in Evas.h is correctly defined */
#endif
#ifdef HAVE_EVIL
# include <Evil.h>
#endif
#include <Eina.h>
#include "Evas.h"