Nat! bio photo


Senior Mull

Twitter Github Twitch

The beginning of a bigger change ?

So I try to compile some older code (10.5) on SnowLeopard and I get:

error: @defs is not supported in new abi

The offending code looks something like this

@interface Foo
   void   *table1_;

static inline BOOL   Foo_IsASpecialObject( Foo *self, id p)
   return( NSHashGet( ((struct { @defs( Foo) } *) self)->table1_, p) != nil);

If you find this a little obscure, I once wrote an article about it (look for Using inline functions instead of method calls)

These are all the solutions to this particular problem I came up with:

  1. don't use the new ABI / abandon platform
  2. pester ABI maintainer to support @defs
  3. pester ABI maintainer to support static inline between @interface and @end
  4. painstakingly create a shadow struct, that mimics the Foo class
  5. unprotect inline accessed instance variables in Foo with @public

Just ignoring the ABI and sticking to 32 bit is a dead end on Mac OS X, so it's not an option. Option #2 and #3, well call me negative but I am also not buying lottery tickets because of the bad odds. Option #4 is extremely fragile, I don't want that. So for now I will have to make the instance variables @public. SIGH!

Post a comment

All comments are held for moderation; basic HTML formatting accepted.

E-mail: (not published)