Re: [AD] END_OF_MAIN, again

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


On Monday 01 August 2005 14:15, Hrvoje Ban wrote:
> There is way, but I don't know how "standard" it is. Both MSVC 6 and 
MinGW 
> use C style name mangling for main in both C and C++. So I can put extern 
> main() in wmain.c and it will work correctly. Need to do some research on 
> this.

Don't do extern int _mangled_main() - since it might be either 
_mangled_main(void) or _mangled_main(int, char**). Instead, use a function 
pointer pointer and point it to _mangled_main (which is what Allegro does 
now, except that it needs to get the address through the END_OF_MAIN()).
I'd also prefer not to rely on potentially unsafe compiler-specific 
name-mangling for anything.

Evert




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