Re: [AD] END_OF_MAIN, again

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


On Monday 01 August 2005 05:15 am, 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.

But that doesn't change _mangled_main, which even if you could rely on main 
always being C-mangled, you can't rely on _mangled_main being C-mangled. The 
only way would be to make _mangled_main use extern "C" in C++, but you can't 
do that because of the return type declared right before it (not to mention, 
it may break uses of main in namespaces and classes).

The only way I can see to get rid of END_OF_MAIN for MSVC and OSX is to redo 
the entrance point.. to have users use something like AL_MAIN instead of 
main/WinMain. However it's too late for that for 4.2.




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