Re: [AD] namespace collision

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


George Foot wrote:
> > 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.

Of course, that was stupid of me :-) But now I come to think of another
problem, which seems more serious:

   class MyClass {
      void clear(void);
      int exists(void);
   };

The method names will be in the object file, so a program containing
such a class will not link properly if we support short Allegro names
though macros. I think `clear' might be a common method name (at least,
it occurs twice in the only program that I have written in C++).

Peter Wang wrote:
> OTOH maybe the default should be _not_ to #define the short names.

Then all old programs will be broken until their author update them. But
if we change this in a WIP people will have some time to fix their
programs. And we can also use Matthew's idea of compiling two versions
of the library, I think that sounds good. It would also solve the
problem with user programs defining eg. clear().

Sven



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