Re: [AD] Proposal for new magic main (2) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> OTOH, we need an easy way to allow programs to compile with both 4.0
> and 4.2.
All is in the definition of 'easy' :-)
The deal could simply be: you can remove END_OF_MAIN() but you must conform to the standard
main() prototype.
> 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.
How often does this happen ? 10% of all Allegro programs ? Either way, we should emphasize
the use of install_allegro().
> 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();
IMHO that's worse than before :-)
--
Eric Botcazou
ebotcazou@xxxxxxxxxx