Re: [AD] version check in allegro_init

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


Peter Wang wrote:

> >Doing this using install_allegro() makes the most sense, but we can't add
> >arguments to the function because it's part of the public API.
>
> Well, we could bend the rules a little.  As Elias suggested we could 
> change install_allegro into a macro.  For the rare cases where people 
> take the address of install_allegro, we still define install_allegro as 
> a function.  If you call install_allegro and bypass the macro you won't 
> get the version check, but that's okay.

If you can think of a way to define a function in a header file only
_once_, you could put an inline function in the headers that returns the
version number. You can then call that function from allegro_init and
compare with the compiled in version numbers. I'm not sure if it's
technically possible to do this without getting multiple definitions
of the function, though.

Hein Zelle

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
 Unix is user friendly. It's just very particular about who 
 it's friends are.

 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<




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