From: Cedric Bail Date: Fri, 27 Oct 2017 22:43:57 +0000 (-0700) Subject: elementary: update EFL_MAIN and EFL_MAIN_EX to use the new EFL exit API. X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~1991 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0764ee81458ce56daf9bc5076044e8799038675a;p=platform%2Fupstream%2Fefl.git elementary: update EFL_MAIN and EFL_MAIN_EX to use the new EFL exit API. --- diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h index bf77620..9324f2a 100644 --- a/src/lib/elementary/elm_general.h +++ b/src/lib/elementary/elm_general.h @@ -123,10 +123,26 @@ extern EAPI double _elm_startup_time; # define _EFL_BUILD_ID NULL #endif -#define _EFL_APP_VERSION_SET() do { if (efl_build_version_set) efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, _EFL_VERSION_MICRO, _EFL_VERSION_REVISION, _EFL_VERSION_FLAVOR, _EFL_BUILD_ID); } while (0) - -#ifndef ELM_LIB_QUICKLAUNCH -#define EFL_MAIN() int main(int argc, char **argv) { int ret__; _EFL_APP_VERSION_SET(); _elm_startup_time = ecore_time_unix_get(); elm_init(argc, argv); efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); ret__ = efl_loop_begin(ecore_main_loop_get()); elm_shutdown(); return ret__; } +#define _EFL_APP_VERSION_SET() \ + do { \ + if (efl_build_version_set) \ + efl_build_version_set(EFL_VERSION_MAJOR, EFL_VERSION_MINOR, _EFL_VERSION_MICRO, \ + _EFL_VERSION_REVISION, _EFL_VERSION_FLAVOR, _EFL_BUILD_ID); \ + } while (0) + +#define EFL_MAIN() int main(int argc, char **argv) \ + { \ + Eina_Value *ret__; \ + int real__; \ + _EFL_APP_VERSION_SET(); \ + _elm_startup_time = ecore_time_unix_get(); \ + elm_init(argc, argv); \ + efl_event_callback_add(ecore_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL); \ + ret__ = efl_loop_begin(ecore_main_loop_get()); \ + real__ = efl_loop_exit_code_process(ret__); \ + elm_shutdown(); \ + return real__; \ + } #define EFL_MAIN_EX() \ EFL_CALLBACKS_ARRAY_DEFINE(_efl_main_ex, \ @@ -136,14 +152,16 @@ extern EAPI double _elm_startup_time; { EFL_LOOP_EVENT_TERMINATE, efl_terminate }); \ int main(int argc, char **argv) \ { \ - int ret__; \ + Eina_Value *ret__; \ + int real__; \ _EFL_APP_VERSION_SET(); \ _elm_startup_time = ecore_time_unix_get(); \ elm_init(argc, argv); \ efl_event_callback_array_add(ecore_main_loop_get(), _efl_main_ex(), NULL); \ ret__ = efl_loop_begin(ecore_main_loop_get()); \ + real__ = efl_loop_exit_code_process(ret__); \ elm_shutdown(); \ - return ret__; \ + return real__; \ } /**