From 0853241009e6bdc080a28eba49781739bb2204dd Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Wed, 4 Dec 2013 05:09:07 +0000 Subject: [PATCH] compiler: Support autoopening of libraries in AROS_SHxx() style programs Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@48503 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/include/aros/shcommands_notembedded.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/include/aros/shcommands_notembedded.h b/compiler/include/aros/shcommands_notembedded.h index 494587a6b8..22eb6dc183 100644 --- a/compiler/include/aros/shcommands_notembedded.h +++ b/compiler/include/aros/shcommands_notembedded.h @@ -11,6 +11,7 @@ #include #include #include +#include #define _stringify(x) #x #define stringify(x) _stringify(x) @@ -57,6 +58,8 @@ DECLARE_main(name); \ DECLARE_DOSBase_global \ \ +THIS_PROGRAM_HANDLES_SYMBOLSET(LIBS) \ + \ __startup static AROS_PROCH(_entry, __argstr, argsize, SysBase) \ { \ AROS_PROCFUNC_INIT \ @@ -97,7 +100,10 @@ __startup static AROS_PROCH(_entry, __argstr, argsize, SysBase) \ goto __exit; \ } \ \ - __retcode = CALL_main(name); \ + if (set_open_libraries()) { \ + __retcode = CALL_main(name); \ + set_close_libraries(); \ + } \ \ __exit: \ if (__rda) FreeArgs(__rda); \ -- 2.11.4.GIT