Re: [AD] namespace collision

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


At 10:23 9/08/01 +0100, George Foot wrote:
>The point about class members (by Evert I think?)

No, by Sven ;-)

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

I agree that this is very ugly, but as I said, I'd be able to live with it.
Still, I understand if others have strong objections to this.

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

True. I think there should be something like

#ifndef DO_NOT_RENAME_SOME_FUNCTIONS
#define clear(bmp) clear_bitmap(bmp)
#endif

so that backward compatibility is maintained while allowing the user to
#define DO_NOT_RENAME_SOME_FUNCTIONS and use clear() for other functions.

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

I agree.

Evert



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