Re: [AD] Magic main in Windows |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Hmm... I was under the impression that MacOS X didn't need the END_OF_MAIN()... looks like I was mistaken. Angelo, any possibility of eliminating it?
Not really... :(The real main() under OSX is actually even executed in a secondary thread... The main thread is special as you can fetch system events from inside it only. So the END_OF_MAIN macro under OSX creates a Cocoa application and executes the user main in a newly spawned thread, then keeps on analizying system events until program ends. Originally I made Allegro to have the main() symbol defined inside the lib itself; later I adopted the SDL way and used a separated static lib: liballeg-main.a. The code of this module is held in src/macosx/main.m, for anyone interested (you could see why I think it's not possible to remove the END_OF_MAIN from the OSX port)
-- Angelo Mottola a.mottola@xxxxxxxxxx http://www.ecplusplus.com
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |