Re: [AD] 4.1.17

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


Evert Glebbeek wrote:
Maybe I just assumed there were others because END_OF_MAIN() keeps poping up as something we can't solve on MacOS X...

I just thought of something...

In the lib:
#undef main
int main(int argc, char *argv[], char *arz[])
{
   void *mangled_main_addr = _mangled_main;
   whatever_magic_stuff_needed();
return ((int(*)(int,char*[],char*[]))mangled_main_addr)(argc, argv, argz);
}

And in the headers:
#define main _mangled_main

The user's main function will become _mangled_main, and the main function in the lib will call it however needed. END_OF_MAIN not required.




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