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

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


> This patch removes the need to place END_OF_MAIN() macro at the end of
> main function by extending "#define main" macro to have all needed
> code.

Unfortunately, this will break code that has a struct member named main.
That may sound like an academic case, but it probably isn't.
It also suffers from the problem that int _mangled_main(); doesn't mean the
same thing in C++ as it does in C, although you can probably get around
that by replacing () with (int argc, char **argv).
How do others feel about this for the 4.3 branch?

> BTW I also tried to remove END_OF_MAIN macro for other platforms and
> find out that it sets _mangled_main_address by couldn't find where it
> is used.

What version of Allegro did you use to make your patch? END_OF_MAIN() is
already optional in DOS and *NIX (although the *NIX port can be configured
to make it nescessary), but needed in Windows and MacOS X. Getting rid of
it on as many platforms as possible is nice, but unless we can do the same
for MacOS X (which, if I recall correctly, we can't) there's not much point
in trying too hard.

Evert




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