Re: [AD] namespace collision

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


In reply to George Foot <gfoot@xxxxxxxxxx>:
>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).

Sorry if I misunderstood, but why is this a problem? #defining a macro
which takes arguments, such as:

  #define clear(bmp) allegro_clear(bmp)

would not affect structure members:

  struct abc {
     int clear;
  };

  printf("%d\n", offsetof(struct abc, clear));

The printf() statement above would *not* expand to:

  printf("%d\n", offsetof(struct abc, allegro_clear));

Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



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