Re: [AD] New END_OF_MAIN() Proposal

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


On Sunday 28 November 2004 00:24, Dustin Dettmer wrote:
> I recently came up with an idea that would remove the
> need for the phrase END_OF_MAIN() after the user's
> 'main' function. 

Hurray!

> It still involves macro magic and
> the 'main' function would still need to have 'int'
> specified, but this method would pretty it up a little
> bit.

Indeed. I think most users specify int main() anyway (as opposed to just 
main()). SDL also forces you to declare main as int main(int, char**). 
However, let's not forget that Allegro never has done this and changing it 
may break existing code...

> Which you can guess as to what it equates to.  This
> method still has the issue of not being able to
> support main() and main(int,char**).  /me curses
> non-overloaded macro functions :P. 

Can't you use a function pointer to _mangled_main similar to the way 
Allegro does now?
(It always calls it as though it were _mangled_main(int, char**)?

> Anyway, its not a perfect or even finished solution,
> just wanted to suggest it cause it had been bouncing
> around in my mind for a while.

Thanks for the input :)
Anything that gets rid of END_OF_MAIN() in a tidy way is welcome by me. 
But: I think the Windows port is the least problematic at the moment. I 
think the MacOS X port is the real problem. I asked a while back if it'd 
be possible to use a constructor function rather than the current method 
but haven't heard back on it...

Evert





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