Re: [AD] namespace collision

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


On Wed, Aug 08, 2001 at 05:22:46PM +1000, Peter Wang wrote:
> On 07 Aug 2001, George Foot <gfoot@xxxxxxxxxx> wrote:
> [snip]
> > I'm more concerned about the way this could break existing code
> > now.
> 
> Just to clarify..
> 
> (a) You're more concerned than you previously were that this
>     preprocessor abuse will break things (system headers, existing
>     code, etc.)
> 
> (b) At the moment, you're more concerned that this preprocessor
>     abuse will break code written with previous versions of Allegro.
> 
> (c) ... ?

Not sure. :)  I think I meant (a).  The whole point of the
defines is not to break old Allegro code; but they instead break
other things.  The point about class members (by Evert I think?)
is a strong one too -- that is a big problem, meaning we mustn't
change the names of class members.

Having two separate libraries is not an option IMHO -- as Evert
said, two DLLs would be required, and Matthew it's not possible
to just use two .def files because some compilers (MSVC) link by
index but others (Mingw) link by symbol name.  But it would be
possible in Windows to use a hacked import library.

Apart from Windows, there would be problems in Unix too, where
it's typical to compile from source.  I'd have to have installed
both prefixed and unprefixed Allegro libraries, which internally
would be essentially the same.

One option for prefixing is to wrap every function in a stub
with the old name, but this is a performance hit everywhere
except Windows (where that's done already in the import
library).  However I don't think we can go ahead with the
renaming when it will break the linkage of people's classes.
For that case, even #define clear(bmp) allegro_clear(bmp) is no
good because the class member could take a parameter.

So we come back to just picking out problem cases and changing
their names -- and still end up not knowing what to call the
mutex functions. :)  Regardless of prefixes for the rest of the
library, I vote for allegro_*_mutex.

Boy am I glad I put prefixes into Libnet and AllegroGL at an
early stage!

George



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