discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libobjc] May I tweak objc-api.h?


From: Alexander Malmberg
Subject: Re: [libobjc] May I tweak objc-api.h?
Date: Fri, 06 Feb 2004 23:57:59 +0100

Ziemowit Laski wrote:
> If you rename 'class' to 'super_class' and reference it as
> 'super_class',
> then this will work in all four of our C flavors, so I'm not sure I
> understand
> your question...

If we reference the field as "super_class", we won't be compatible with
gcc <= 3.4. That isn't an option for GNUstep.

>  Or are you suggesting that we do something like
> 
>    #ifdef __cplusplus
>      Class super_class;
>    #else
>      Class class;
>    #endif

Yes. Not pretty, but FWIW, the same pattern can be seen in several other
headers here.

> While possible, I'd submit that this approach will be more confusing
> in the long run.

It isn't optimal, but that's the price of compatibility. We do need some
way of writing code that will work with "all" versions of gcc. This
can't be the first time there's a name conflict like this, so there may
be some established way of dealing with it. #ifdef __cplusplus is the
only one I recall seeing.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]