Re: [AD] END_OF_MAIN, again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] END_OF_MAIN, again
- From: chris.kcat@xxxxxxxxxx
- Date: Sat, 30 Jul 2005 12:53:14 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=KVVLPqUKc96M2JDcNStY03RajyPtu+i9P1Jseo0QvBFUhU1AbpJFp+YILSFclWGkmQB5rwyrpO8l4QafuvyXJZIhd/euQQBYhMa4NeAJS6Yd+YwrwEvfxQyDFwItQwRwmY9/ZG2SEMr45iM/PheSLTd5n1gqjQaZMLgHEulhaaU=
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.