Re: [AD] END_OF_MAIN removal patch for msvc

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


Evert Glebbeek wrote:
On 17 Nov 2008, at 20:08, torhu wrote:
#define main _mangled_main(int, char**);  \
     int main(int argc, char** argv)       \
     {                                     \
         do_allegro_stuff(argc, argv);     \
         return _mangled_main(argc, argv); \
     }                                     \
     int _mangled_main

Syntax error aside, that'll do really nasty things to my struct member "int main".


GCC seems to think that code is syntactically correct.

Allegro already uses "#define main _mangled_main". Not that I think that's a good thing, though. Anyway, I'm just thinking out loud.

Because of the strict prototyping in C++, we'd have to require the user
to always define main to take two args.

Urgh. No.

Not so for C.  At least END_OF_MAIN would be gone.

Not worth it at that price if it were true, but not in fact true: that isn't enough for OS X.

I don't know exactly what's required, but do_allegro_stuff() could run the user's main in a secondary thread if it wanted to. I'll leave that to someone who knows OS X.




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