Re: [AD] END_OF_MAIN, again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] END_OF_MAIN, again
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Mon, 1 Aug 2005 14:34:29 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=Ouk/eENEo27i52Wk4dc2bWZoEN9PisQdxy7iX8UQh0RPuK1a300Zr0UMvEkJrT2Qn4PQRzlc+gFL2lItaTN/E5lZkil4LSNS8WxAa0SJEoozEH0weyMKVuv4AbP5OC7Rly2fenn7/xbzu2vVSLupNk2pzHyt5dmwjA1W825mjwc=
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.