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

Greg Parker gparker@apple.com
Fri Feb 6 23:32:00 GMT 2004


On Feb 6, 2004, at 2:57 PM, Alexander Malmberg wrote:
> 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.

How many places does GNUstep actually use struct objc_super's fields? 
If it's only one or two places then it might be easier to move the 
conditional to GNUstep's source.

#if __GCC_VERSION__ >= 3.5   // or however you spell this
    my_objc_super->super_class = foo;
#else
    my_objc_super->class = foo;
#endif

The choice seems to be compiler-version-check (for those who want to 
build on an older compiler) versus language-check (for those who want 
to build on both ObjC and ObjC++).

Of course, objc_super itself is used in so few places that it probably 
doesn't matter either way.


-- 
Greg Parker     gparker@apple.com    Runtime Wrangler



More information about the Gcc mailing list