Re: [AD] No need for END_OF_MAIN (Windows)

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


On 2005-05-13, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> > How do others feel about this for the 4.3 branch?
> 
> I think we should try to find a way with not so much
> magic. Currently, two platforms need it, for different reasons:
> 
> Windows: Instead of main(), the main function is called WinMain,
> so all the magic involved is to provide a WinMain which calls
> the user main.
> 
> OSX: The user's main function must run in a thread created by
> Allegro, so we provide another main, which creates that thread
> and calls the user main.

At the moment Allegro is slightly odd to use with script languages
because of this main mangling need. See pyallegro's code:

   /* needed if Allegro is built as a shared library */    
   int main(void)
   {
           return 0;
   }
   END_OF_MAIN();

It would be good if Allegro could be a normal library, and the
mangling code was in some header file that only full featured C
programs required, or could implement manually if desired.




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