Re: [AD] namespace collision

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


>>    "allegro.h"  has unprefixed functions  "liballeg.a" built unprefixed
>>    "allegro_.h"  has #defines    "liballe_.a"  has prefixes
>
>Whilst I don't like the idea of compiling the library twice just to get
>different names for functions, we could make this a compile-time option.
>That way, developers for previous versions of Allegro could continue to
>use that just fine, but new developers (or forward-looking developers)
>could use a different library with different names.

I think this is the best way to go, though. It solves all the problems
mentioned above, and it doesn't require a tremendous amount of work: we
just create a headerfile (say sys/alprefix.h) containing something along
the lines of

#ifdef ALLEGRO_USE_PREFIX
...
#define allegro_create_bitmap create_bitmap
...
#endif

which gets included in each source file. Then, by adding an option to the
makefile, the addition of prefixes can be selected by the user at compile
time.

The only drawback I see is that it requires two headerfiles for the library
(say allegro.h and allegro_.h for the non-prefixed and the prefixed version
respectively, as suggested), two versions of the linker library (say
liballeg.a and liballeg_.a), and two versions of the shared library, for
instance in Windows allegro.dll and allegro_.dll.
This, I think, is a small prise to pay. The ultimate user of programs
created with allegro may end up with two copies of essentially the same
shared library, but I don't think this'll be such a bad things, since the
Allegro dll is only about 450kB.

Well, just my thoughts.

Evert
-- 
Evert Glebbeek, Physics student
Faculty of science, University of Amsterdam
e-mail: eglebbk@xxxxxxxxxx   ICQ: 48210348
www: http://www.science.uva.nl/~eglebbk/ 



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