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

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


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

> 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.:

Why ? everything in alcompat.c can be defined out by OLD_ALLEGRO_API,
and thus not defining it would essentially link against an empty file.

> > 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).

Ah yes. One wishes for references. We could possibly do something
about that with those:

int &allegro_mouse_x = mouse_x;

You'd probably run into trouble if trying to take the address of that,
though, or sizeof it.

> 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

Thinking about it, it need not change the user's code. If Allegro is
compiled with backward compatibility support, then it can define this
flag itself, so no change to user code would be needed. Or did I miss
something ?

> 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.

I seem to not find this post. Can anyone forward it to me please ?
I have answers to it, but not Peter's first one, I must have deleted
it somehow (I only have "[AD] to prefix or not to prefix (sigh)")

--
Vincent Penquerc'h



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