Re: [AD] END_OF_MAIN removal patch for msvc

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


I'd rather have things out in the open instead of macro magic or some
weaselly thread hacks. Could we not put the real main in a static lib
and have the user put their code in allegro_main(). Real main would
look like
// For platforms that don't need a separate thread
int main(int argc, char argv[])
{
 al_init();
 return allegro_main(argc, argv);
}

// For platforms that do
int main(int argc, char argv[])
{
 al_init();
 store_args_somewhere(argc, argv);
 start_in_new_thread(allegro_main);
 enter_main_loop();
 // Never gets here
 return 0;
}

This would be OK for the straightforward 'pure' Allegro apps.

Then for the advanced user writing plugins or whatever they'd just
have to write their own main() function maybe with some help from
macros like AL_PLATFORM_NEEDS_SECONDARY_THREAD or whatever.

I know Jon Rafkind tried to mate Allegro 4 and Scheme and we just
couldn't do it on OS X because of the threading issue.

Peter




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