Re: [AD] namespace collision

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


On 07 Aug 2001, George Foot <gfoot@xxxxxxxxxx> wrote:
> On Tue, Aug 07, 2001 at 08:59:05PM +0200, Sven Sandberg wrote:
> >  d) A user program defines its own structures, e.g.:
> >        struct {
> >           int clear;
> >           int exists;
> >        } foo;
> >     or
> >        enum {
> >           circle, ellipse, line, triangle, rect, polygon, arc, spline
> >        } object_shape;
> 
> I hadn't thought of that.  It would mean you have to include
> allegro.h before all other headers (including real system
> headers), which is a bit ugly.  Defines are so ugly.

If we #define macros (with arguments, rather than without) for
functions, then the number of possible problems will be severely
reduced, I think.  But then taking the address of unprefixed
"functions" will not work.

OTOH maybe the default should be _not_ to #define the short names.

[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) ... ?
    
-- 
tjaden@xxxxxxxxxx - http://www.alphalink.com.au/~tjaden/
Perl hackers do it unorthogonally.



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