Re: [AD] END_OF_MAIN, again

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sat, 2005-07-30 at 14:28 +0200, Hrvoje Ban wrote:
> On 7/30/05, Elias Pschernig <elias@xxxxxxxxxx> wrote:
>         Will it work if the user code uses allegro_init?
> 
> Yes (tested). 

Ah, yes, of course. The __install_allegro doesn't need to be called,
it's just to stop the linker from dropping it.
> 
>         Need to have someone test it under MSVC.
> 
> I was able to build library and compile "Hello World!" program. It
> worked fine, but complains about __mangled_main and __install_allegro
> being imported 

What is the exact message? And any way to get rid of it?

> 
>         Unix already doesn't do anything in END_OF_MAIN. But there's
>         no known
>         way to get rid of it under OSX so far.
> 
> As far I understand macosx/main.m it used _mangled_main_address which
> is defined in user code by END_OF_MAIN(). Has anyone tried to use
> _mangled_main directly (return _mangled_main(argc, argv); ?
>  

The problem in OSX is different.. main() must not be in the main thread
there. So the real main() created a thread, and then calls the user
main() (renamed to _mangled_main) in that other thread.

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/