Re: [AD] namespace collision

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


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.

> I'm not sure if d) is serious or not. If it only appears in user
> programs, then it is only a problem if such a structure is used in one
> file which #includes allegro.h and also in another which does not,

That's not a problem because names of struct members don't
affect their offsets.  Within each file, the members would
either be renamed or not.  There is still the potential problem
of clashes though (one struct or enum having members named
circle and allegro_circle).

I'm more concerned about the way this could break existing code
now.

George

-- 
Random project update:
22/06/2000: AllegroGL documentation:  http://allegrogl.sourceforge.net/
        See under `Documentation' for the AllegroGL Reference Manual in
        various formats.



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