cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0dfb263a28691f70dd4fe385e2bdbe2b65cdbcf9

commit 0dfb263a28691f70dd4fe385e2bdbe2b65cdbcf9
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Tue Apr 28 14:21:27 2015 +0200

    eina: remove the need to order the header correctly for Windows.
---
 src/lib/eina/Eina.h        |  3 +++
 src/lib/eina/eina_module.h |  4 ++--
 src/lib/eina/eina_types.h  | 22 ++++++++++++++++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/lib/eina/Eina.h b/src/lib/eina/Eina.h
index 672c094..b0b24ee 100644
--- a/src/lib/eina/Eina.h
+++ b/src/lib/eina/Eina.h
@@ -265,6 +265,9 @@ extern "C" {
 #include <eina_matrix.h>
 #include <eina_crc.h>
 
+#undef EAPI
+#define EAPI
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/lib/eina/eina_module.h b/src/lib/eina/eina_module.h
index 834dfa8..d1030b9 100644
--- a/src/lib/eina/eina_module.h
+++ b/src/lib/eina/eina_module.h
@@ -96,14 +96,14 @@ typedef void (*Eina_Module_Shutdown)(void);
  * declares the given function as the module initializer (__eina_module_init).
  * It must be of signature #Eina_Module_Init
  */
-#define EINA_MODULE_INIT(f) EAPI Eina_Module_Init __eina_module_init = &f
+#define EINA_MODULE_INIT(f) EXPORTAPI Eina_Module_Init __eina_module_init = &f
 
 /**
  * @def EINA_MODULE_SHUTDOWN
  * declares the given function as the module shutdownializer
  * (__eina_module_shutdown). It must be of signature #Eina_Module_Shutdown
  */
-#define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown 
__eina_module_shutdown = &f
+#define EINA_MODULE_SHUTDOWN(f) EXPORTAPI Eina_Module_Shutdown 
__eina_module_shutdown = &f
 
 extern EAPI Eina_Error EINA_ERROR_WRONG_MODULE;
 extern EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED;
diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h
index 0c92ae4..2e0c4d7 100644
--- a/src/lib/eina/eina_types.h
+++ b/src/lib/eina/eina_types.h
@@ -61,6 +61,28 @@
 # endif
 #endif
 
+#ifdef _WIN32
+# ifdef DLL_EXPORT
+#  define EXPORTAPI __declspec(dllexport)
+# else
+#  define EXPORTAPI
+# endif /* ! DLL_EXPORT */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EXPORTAPI __attribute__ ((visibility("default")))
+#  else
+#   define EXPORTAPI
+#  endif
+# else
+/**
+ * @def EAPI
+ * @brief Used to export functions(by changing visibility).
+ */
+#  define EXPORTAPI
+# endif
+#endif
+
 #include "eina_config.h"
 
 #ifdef EINA_UNUSED

-- 


Reply via email to