Re: [AD] No need for END_OF_MAIN (Windows)

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


On Saturday 14 May 2005 10:18, spoofer255@xxxxxxxxxx wrote:
> This new patch defines main to _mangled_main like old way but instead
> of using END_OF_MAIN() to place WinMain it puts it into header. This
> works fine, but trick is that compiler will generate WinMain for each
> source file that includes allegro.h. GCC doesn't mind this and will
> link without problem, but I'm not sure about MSVC.

I would be very surprised if that  doesn't give problems somewhere some 
how. Does it really work well if you compile and link a multi-file 
project? Does this mean a WinMain is added to each Allegro sourcefile that 
ends up in the library or DLL?
Note that for GCC, there seems to be an even simpler fix: don't use WinMain 
at all and just use a regular main() function. As far as I could test a 
while back, this works just fine.
Anyway, I'm not too fond of adding a WinMain() to each sourcefile, unless 
it can be absolutely shown that this will not ever cause problems.

That aside, one problem with the patch is that you still have the evil int 
_mangled_main(); prototype.

Evert




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