* undef close() and open() in evas_module also for mingw
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 30 Jan 2010 00:09:29 +0000 (00:09 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 30 Jan 2010 00:09:29 +0000 (00:09 +0000)
 * init Evil in eina as it uses fcntl() with the winsock2 library
 * fix compilation of evas_cache_image.c with mingw
 * formatting

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@45724 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/cache/evas_cache_image.c
src/lib/canvas/evas_main.c
src/lib/file/evas_module.c
src/lib/include/evas_common.h

index 534130d..0821b3a 100644 (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;
index 1507349..8b18367 100644 (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;
 }
index 1dde1f1..e00f4e7 100644 (file)
@@ -8,7 +8,7 @@
 #include <evas_private.h>
 #include <evas_module.h>
 
-#ifdef _MSC_VER
+#ifdef _WIN32
 # ifdef open
 #  undef open
 # endif
index aab86c3..c5c0fe9 100644 (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"