Re: [AD] Proposal for new magic main (2)

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


On 2002-03-29, Lo'oRiS il Kabukimono <_lano_@xxxxxxxxxx> wrote:
> > We could always make so that allegro_init() is an alias for
> > install_allegro(argc, argv, SYSTEM_AUTODETECT, &errno, atexit), but
> > I'm not sure that would be better.
> 
> IMHO it is better :)

[random thoughts]

It's still going to break (and often) because of "int main(void)".
In those cases, it only saves changing a single line of code.

OTOH, we need an easy way to allow programs to compile with both 4.0
and 4.2.  Is the following recipe too hard?  Putting argc, argv into
`allegro_init' would make it easier for this common case, but if you
call `allegro_init' from outside `main' you're out of luck.

   int main(int argc, char *argv[])
   {
   #if (ALLEGRO_VERSION == 4) && (ALLEGRO_SUB_VERSION == 0)
      allegro_init();
   #else
      allegro_init(argc, argv);
   #endif
      ...
   }
   END_OF_MAIN();

(END_OF_MAIN definitely should go in alcompat.h)



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