diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index fcdc7b4f5c..ea7ef0603d 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -722,6 +722,7 @@ endif EXTRA_DIST2 += \ lib/elementary/elm_factory.h \ lib/elementary/elm_factory.c \ + lib/elementary/elm_module_helper.h \ $(top_srcdir)/elm_intro.h.in ### Binary diff --git a/src/lib/elementary/elm_module.c b/src/lib/elementary/elm_module.c index 03f70dc032..92557b1d50 100644 --- a/src/lib/elementary/elm_module.c +++ b/src/lib/elementary/elm_module.c @@ -111,6 +111,7 @@ _elm_module_find_as(const char *as) if (!_elm_module_load(m)) { + ERR("Failed to load elementary module: '%s': %m", m->as); _elm_module_del(m); return NULL; } diff --git a/src/lib/elementary/elm_module_helper.h b/src/lib/elementary/elm_module_helper.h new file mode 100644 index 0000000000..f4e7d22a99 --- /dev/null +++ b/src/lib/elementary/elm_module_helper.h @@ -0,0 +1,34 @@ +/* A small helper header defining EAPI for elementary modules, it should be + * included last in the modules C files. + */ + +#ifndef ELM_MODULE_HELPER_H +#define ELM_MODULE_HELPER_H + +#ifdef EAPI +# undef EAPI +#endif + +#ifdef _WIN32 +# ifdef ELEMENTARY_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif /* ! DLL_EXPORT */ +# else +# define EAPI __declspec(dllimport) +# endif /* ! EFL_EVAS_BUILD */ +#else +# ifdef __GNUC__ +# if __GNUC__ >= 4 +# define EAPI __attribute__ ((visibility("default"))) +# else +# define EAPI +# endif +# else +# define EAPI +# endif +#endif /* ! _WIN32 */ + +#endif diff --git a/src/modules/elementary/access_output/mod.c b/src/modules/elementary/access_output/mod.c index 0dff159885..e304c2ecae 100644 --- a/src/modules/elementary/access_output/mod.c +++ b/src/modules/elementary/access_output/mod.c @@ -3,6 +3,7 @@ #endif #include +#include "elm_module_helper.h" /* to enable this module export ELM_MODULES="access_output>access/api" diff --git a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c index 95f123224b..b3b90b6f20 100644 --- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c +++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c @@ -5,6 +5,7 @@ #include #include "elm_widget.h" #include "efl_ui_clock_private.h" +#include "elm_module_helper.h" #define CLOCK_FIELD_COUNT 8 #define FIELD_FORMAT_LEN 3 diff --git a/src/modules/elementary/prefs/private.h b/src/modules/elementary/prefs/private.h index f65370bedf..197162d5d5 100644 --- a/src/modules/elementary/prefs/private.h +++ b/src/modules/elementary/prefs/private.h @@ -2,6 +2,7 @@ # include "elementary_config.h" #endif #include "Elementary.h" +#include "elm_module_helper.h" #undef CRI #undef ERR diff --git a/src/modules/elementary/test_entry/mod.c b/src/modules/elementary/test_entry/mod.c index 623cb48609..621f40a32a 100644 --- a/src/modules/elementary/test_entry/mod.c +++ b/src/modules/elementary/test_entry/mod.c @@ -3,6 +3,7 @@ #endif #include +#include "elm_module_helper.h" // module api funcs needed EAPI int diff --git a/src/modules/elementary/test_map/mod.c b/src/modules/elementary/test_map/mod.c index 9dfc352b5b..fd5dcdb03e 100644 --- a/src/modules/elementary/test_map/mod.c +++ b/src/modules/elementary/test_map/mod.c @@ -5,6 +5,7 @@ #include "Elementary.h" #include "elm_widget_map.h" #include +#include "elm_module_helper.h" EAPI Eina_Stringshare * map_module_source_name_get(void) diff --git a/src/modules/elementary/web/none/elm_web_none.c b/src/modules/elementary/web/none/elm_web_none.c index a371e7945f..91292e0bd4 100644 --- a/src/modules/elementary/web/none/elm_web_none.c +++ b/src/modules/elementary/web/none/elm_web_none.c @@ -9,6 +9,7 @@ #include "elm_priv.h" #include "elm_widget_web.h" #include "elm_web_none.eo.h" +#include "elm_module_helper.h" #define MY_CLASS ELM_WEB_CLASS