From 9123253d95340573585f19d251792c3fe4b46500 Mon Sep 17 00:00:00 2001 From: caro Date: Sat, 27 Aug 2011 07:54:49 +0000 Subject: [PATCH] change the way elm_main() must be declared (fix bug on Windows). Instead of EAPI elm_main(***), it must be EAPI_MAIN elm_main(***) so that it also work on Windows. If someone knows sed a bit, can he also change all the examples ? git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@62885 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- doc/widgets/Makefile.am | 4 ---- doc/widgets/widget_preview_tmpl_head.c | 2 +- src/bin/Makefile.am | 4 ---- src/bin/config.c | 2 +- src/bin/test.c | 2 +- src/lib/Elementary.h.in | 11 ++++++++--- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/doc/widgets/Makefile.am b/doc/widgets/Makefile.am index 9bacc93..86343c8 100644 --- a/doc/widgets/Makefile.am +++ b/doc/widgets/Makefile.am @@ -21,10 +21,6 @@ AM_CPPFLAGS = \ @ELEMENTARY_EMAP_CFLAGS@ \ @EIO_CFLAGS@ -if ELEMENTARY_WINDOWS_BUILD -AM_CPPFLAGS += -DELEMENTARY_BUILD -endif - noinst_PROGRAMS = \ widget_preview_button1 \ widget_preview_button2 \ diff --git a/doc/widgets/widget_preview_tmpl_head.c b/doc/widgets/widget_preview_tmpl_head.c index cfec07d..f5fdeda 100644 --- a/doc/widgets/widget_preview_tmpl_head.c +++ b/doc/widgets/widget_preview_tmpl_head.c @@ -5,7 +5,7 @@ # define __UNUSED__ #endif -EAPI int +EAPI_MAIN int elm_main(int argc __UNUSED__, char **argv) { Evas_Object *win, *bg; diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 6691a7b..43fa6c3 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -21,10 +21,6 @@ AM_CPPFLAGS = \ @ELEMENTARY_EMAP_CFLAGS@ \ @EIO_CFLAGS@ -if ELEMENTARY_WINDOWS_BUILD -AM_CPPFLAGS += -DELEMENTARY_BUILD -endif - bin_PROGRAMS = @ELEMENTARY_TEST_PRG@ @ELEMENTARY_CONFIG_PRG@ if BUILD_QUICKLAUNCH bin_PROGRAMS += elementary_quicklaunch elementary_run elementary_testql diff --git a/src/bin/config.c b/src/bin/config.c index 5f32d19..72d01e9 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -2967,7 +2967,7 @@ _exit_timer(void *data __UNUSED__) /* this is your elementary main function - it MUST be called IMMEDIATELY * after elm_init() and MUST be passed argc and argv, and MUST be called * elm_main and not be static - must be a visible symbol with EAPI infront */ -EAPI int +EAPI_MAIN int elm_main(int argc, char **argv) { diff --git a/src/bin/test.c b/src/bin/test.c index debd5ec..49fd727 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -466,7 +466,7 @@ add_tests: /* this is your elementary main function - it MUST be called IMMEDIATELY * after elm_init() and MUST be passed argc and argv, and MUST be called * elm_main and not be static - must be a visible symbol with EAPI infront */ -EAPI int +EAPI_MAIN int elm_main(int argc, char **argv) { Eina_Bool test_win_only = EINA_FALSE; diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 1d31ea8..b93c74c 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -52,7 +52,7 @@ organisations behind this, as listed in the @ref authors page. * @code #include -EAPI int +EAPI_MAIN int elm_main(int argc, char **argv) { // create window(s) here and do any application init @@ -191,7 +191,7 @@ on_done(void *data, Evas_Object *obj, void *event_info) elm_exit(); } -EAPI int +EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *box, *lab, *btn; @@ -420,6 +420,11 @@ contact with the developers and maintainers. # endif #endif /* ! _WIN32 */ +#ifdef _WIN32 +# define EAPI_MAIN +#else +# define EAPI_MAIN EAPI +#endif /* allow usage from c++ */ #ifdef __cplusplus @@ -12560,7 +12565,7 @@ extern "C" { * @code * #include * #ifndef ELM_LIB_QUICKLAUNCH - * EAPI int + * EAPI_MAIN int * elm_main(int argc, char **argv) * { * Ethumb_Client *client; -- 2.7.4