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

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


Vincent Penquerc'h wrote:
> It kind of bothers me to have this fork, for no reason that compels
> me. Having a branch with unprefixed stuff that will have to be
> maintained (somehow), without a foreseable end. Merging patches from
> the HEAD might prove more and more troublesome as HEAD evolves,
> becoming a real burden.

This is a fair argument, although I think that 4.0 would stabilize to a
bug-free library fairly soon so that no more support is needed. But it
also gives me a new idea: We could keep the old and new libraries
together, and optionally compile the old library during make. When
compiling the old library, each of Allegro's source files would #include
"alcompat.h", which would be a very internal header that redefines all
names of Allegro's variables just like we discussed. However, this does
not give the same problems with struct fields being redefined because we
have full control over which struct fields Allegro's source code uses
(as opposed to the struct fields used by Allegro users). Old user
programs would keep #including <allegro.h>, which contains all the old
names, no new ones and no compatibility macros. New user programs would
#include <allegro5.h>, which contains all the new names, no old ones and
no compatibility macros.

This does not give any problems with forking, neither does it give the
users problems with compatibility headers not working. It does however
give some hassles (solvable, I think) for Allegro developers if we
wanted to take the opportunity to change other parts of the API. E.g.,
if we want to change the order of arguments to draw_sprite(), then we'd
need to write:

   AL_INLINE(void, draw_sprite, (BITMAP *d, BITMAP *s, int x, int y),
   { al_draw_sprite(s,d,x,y);})

Or if we remove text_mode() and instead add an extra background_color
argument to textout() & co, then we would need a wrapper for this in the
old-style library. 

So this gives us two options: to keep the non-prefixed library together
with or separated from the prefixed one. I don't know which is easiest
though...

Sven



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