Re: [AD] official beta (Re namespace again)

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


Vincent Penquerc'h wrote:
> and in, say alcompat.c, if OLD_ALLEGRO_API is defined, have:

If it's in alcompat.c, it means we still need two librares: one with
alcompat.c and one without it. I'll assume what Bob said, i.e.:

   static volatile char *key = al_key;

in allegro.h.

> volatile char *key = al_key;
> 
> We need not use macros for everything.
> Would it be possible to cover all (or most) cases with such things ?

No, only global pointers. There are lots of global non-pointers in
Allegro (grep "AL_VAR.*int," allegro.h). Not all of them are likely to
appear as user variable names, but some are (e.g. mouse_x).

Plus, with my definition of backwards compatibility, you don't have to
change the code at all. In particular you don't have to #define
OLD_ALLEGRO_API in your code, nor rearrange the order in which headers
are #included. This is important because if a program is distributed in
source form, then not everyone who compiles it is a programmer, hence
not everyone has the ability to do even trivial changes. And even if the
person who compiles it _is_ a programmer, it doesn't necessarily mean he
knows the least bit about Allegro or what incompatibilities it may have
introduced in the past.

So my opinion is that we should stick with Peter's suggestion #2 (see
the thread "Re: [AD] to prefix or not to prefix (part 2)"), which AFAICS
gives totally problem-free full backwards compatibility forever (because
we don't abandon 4.0), along with a new clean prefixed API and no need
to mess with compatibility headers.

Sven



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