1 /* Workaround for SDL on OS X, based on the corresponding file in TimePiece-0.0.5
2 * http://hackage.haskell.org/package/TimePiece ,
3 * placed in the public domin by by Audrey Tang <audreyt@audreyt.org>. */
9 #include <objc/objc-runtime.h>
14 #ifdef __GLASGOW_HASKELL__
15 #include "Main_stub.h"
16 extern void __stginit_Main ( void );
20 int SDL_main(int argc
, char *argv
[])
22 int main(int argc
, char *argv
[])
29 objc_msgSend(objc_lookUpClass("NSAutoreleasePool"), sel_getUid("alloc"));
30 objc_msgSend(pool
, sel_getUid("init"));
33 hs_init(&argc
, &argv
);
34 #ifdef __GLASGOW_HASKELL__
35 hs_add_root(__stginit_Main
);
43 objc_msgSend(pool
, sel_getUid("release"));