1 #include <intuition/intuition.h>
2 #include <proto/exec.h>
3 #include <proto/intuition.h>
6 /* SAS C 6.50 kludge */
8 #if __VERSION__ > 6 || __REVISION__ >= 50
9 #define exit(x) return x
13 /* AROS kludge, see below */
16 #include <aros/symbolsets.h>
20 #define exit(x) return x
23 extern STRPTR _ProgramName
;
24 struct Library
*MiamiBase
= NULL
;
26 LONG STDARGS CONSTRUCTOR
_STI_200_openMiami(void)
28 struct Library
*IntuitionBase
;
30 MiamiBase
= OpenLibrary("miami.library", 0);
34 IntuitionBase
= OpenLibrary("intuition.library", 36);
36 struct EasyStruct libraryES
;
38 libraryES
.es_StructSize
= sizeof(libraryES
);
39 libraryES
.es_Flags
= 0;
40 libraryES
.es_Title
= _ProgramName
;
41 libraryES
.es_TextFormat
= "Unable to open miami.library";
42 libraryES
.es_GadgetFormat
= "Exit %s";
44 EasyRequestArgs(NULL
, &libraryES
, NULL
, (APTR
)&_ProgramName
);
46 CloseLibrary(IntuitionBase
);
51 void STDARGS DESTRUCTOR
_STD_200_closeMiami(void)
54 CloseLibrary(MiamiBase
);
62 * Unfortunately AROS startup code does not support early exit().
63 * This can be considered a serious C++ compatibility problem since
64 * constructors of static objects may throw exceptions,
65 * involving exit() or abort() calls.
68 static ULONG
AROS_openMiami(void)
70 return _STI_200_openMiami() ? FALSE
: TRUE
;
73 ADD2INIT(AROS_openMiami
, 10);
74 ADD2EXIT(_STD_200_closeMiami
, 10);