Re: [AD] END_OF_MAIN, again

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


On Saturday 30 July 2005 11:13 am, Hrvoje Ban wrote:
> On 7/30/05, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> > True. It's the same you do in windows - instead of storing the address
> > of the main function in a function pointer, you simply call it.
> >
> > But surely someone thought of that in the past discussions on this topic
> > - so there must be another catch.
>
> I didn't found anything in archives about this "catch", but this solution
> by Chris looks interesting:
> http://sourceforge.net/mailarchive/message.php?msg_id=10216287

The problem with that, as it turns out, is that fork starts a whole new 
process. The original process would not be able to update the input variables 
in a way that the new process can see.

As for your WinMain solution, does this allow the user to override it and make 
their own WinMain? And your warning may be from not using the dllexport or 
dllimport tags (I forget the exact syntax).

And I think I see a potential problem. It's bad form to use double-underscores 
for the beginning of a name.. those are reserved for the compiler (however 
unlikely it'll use that name). I'd recommend changing it to something else 
that starts with a single underscore.

Also, your changes make install_allegro called from inside the library. 
install_allegro itself is supposed to be inlined so the program can check the 
Allegro version it was compiled with against the library's version. You could 
avoid this by using _install_allegro instead of install_allegro. You can even 
change install_allegro to call _install_allegro_wrapper directly, without the 
need for the define override.




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