Re: [AD] Magic main in Windows |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon, Aug 02, 2004, Evert Glebbeek wrote:
> On Monday 02 August 2004 13:48, Sam Hocevar wrote:
> > They both do. The only one I had problems with was Borland's (but I
> > only have version 6; maybe people who own more recent versions might
> > check that).
>
> I'm curious to hear about that, personally...
Sorry, I checked again, it was not version 6. My CD is from
C++Builder 5.0.
> What was the problem exactly?
> Can you try the most recent WIP? It adds an allegro_icon weak symbol to the
> library to set the X11 icon. I haven't heard about problems with this yet,
> but the WIP is somewhat recent.
Underfined weak symbols make it impossible to prelink a binary
because those symbols are only resolved at runtime. Also, you
cannot strip symbols from the main executable. And it is also not
possible to make real library wrappers: if I create a libfoo library
that links against allegro, I have to link the final program with
-lalleg_unsharable even if it only uses symbols from libfoo and not
allegro.
I believe it is much cleaner to have an allegro_set_icon() function
in the API than to depend on the presence of an allegro_icon symbol in
the main program.
> > To maintain compatibility with binaries linked with classic Allegro
> > versions, (which don't contain a main() routine) I have added the
> > following code to src/unix/umain.c:
>
> If all goes well (that is, there are no further problems with my new
> get_executable_filename), then we no longer even need a magic main on
> *nix, and we can delete umain.c from the sourcetree.
> This would be an ideal situation IMO.
That would be nice indeed, though I'd have done it the GTK+ way:
having allegro_init() accept argc and argv as arguments, or 0/NULL, so
that no ugly /proc parsing is necessary (on my grsec laptop, non-root
users cannot browse /proc except for specific cases).
Regards,
Sam.
--
Sam Hocevar <sam@xxxxxxxxxx> <http://sam.zoy.org/>
Racism is so gay! How could you ever be racist?