Re: [AD] namespace collision

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


On Fri, Aug 10, 2001 at 10:25:41AM +0100, Shawn Hargreaves wrote:
> On the third hand, Allegro already has a mechanism to provide reliable
> inlines on all compilers: the AL_INLINE macro in the headers, coupled
> with src/inline.c. This could be extended to provide API wrappers, 
> although the need for a separately compiled copy of the functions
> (produced by inline.c) means the wrappers do need to be linked into
> the lib, rather than purely expanded out in a header. That shouldn't
> cause any linker problems as long as the object containing wrappers 
> is kept totally isolated from everything else, though, as the linker
> just won't include it unless someone actually uses these wrapped
> functions.

I thought of this but it kind of defeats the point of wrapping
in the first place -- it would mean that you have to link curses
(for example) before Allegro, otherwise you'll get Allegro's
clear instead of the curses clear.  Is the library linking order
thing reliable on non-Unix compilers too?  I've never really
known whether it's a gcc thing, a Unix thing, or a specified C
thing.

It's a shame you can't just do a namespace-like thing to
automatically prefix all symbols in a library.

George

-- 
Random project update:
06/08/2001: AllegroGL 0.0.16 is at http://allegrogl.sourceforge.net/



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