Re: [AD] version check in al_init

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


On 2010-03-02, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> On Tue, Mar 2, 2010 at 12:51 AM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> 
> > On 2010-03-01, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > > Just spent some time wondering about weird looking graphics and strange
> > > crashes until I figured out I had compiled my code with the SVN headers
> > > but linked against the 4.9.17 libraries.
> > >
> > > The attached patch prevents that, like we do it in A4. It still doesn't
> > > prevent you from loading incompatible addons - not sure how we could
> > > solve that as no macros are involved... maybe add some wrapper macros
> > > for the addon init functions.
> >
> > I don't think it's that important.
> >
> 
> It's hard to say. Everyone using the 4.9.x branch can be affected, and once
> we are on 5.1.x many will have the incompatible 5.0.x libraries around.

You have to try pretty hard to link with addons that don't match the
core library.

5.1.x libraries won't be confused with 5.0.x libraries because they will
be named differently.

> The
> patch doesn't actually fix my problem since 4.9.17 doesn't have the check,
> so I'm thinking maybe the check is better put into the macro itself?
> Something like:
> 
> #define al_init() al_is_version_ok(ALLEGRO_VERSION) ? al_install_system() :
> false

Maybe ask the user to pass ALLEGRO_VERSION to al_install_system() as a
parameter, then

    #define al_init()	al_install_system(ALLEGRO_VERSION, atexit)

Peter




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