GCCBackwardsCompat.h 808 B

123456789101112131415161718192021222324
  1. // Originally from Ryan Petrich's Theos fork, licensed under GNU GPL v3
  2. // https://github.com/rpetrich/theos/blob/master/Prefix.pch
  3. #ifndef __has_feature
  4. #define __has_feature(feature) 0
  5. #endif
  6. #ifndef __clang__
  7. #define weak assign
  8. #define strong retain
  9. // Fix old GCC versions not identifying the correct response type on [[NSDictionary alloc] initWithContentsOfFile:...] and other similar calls
  10. #define THEOS_WORKAROUND_ALLOC(type) @interface type() + (type *)alloc; @end
  11. THEOS_WORKAROUND_ALLOC(NSDictionary);
  12. THEOS_WORKAROUND_ALLOC(NSMutableDictionary);
  13. THEOS_WORKAROUND_ALLOC(NSArray);
  14. THEOS_WORKAROUND_ALLOC(NSMutableArray);
  15. #undef THEOS_WORKAROUND_ALLOC
  16. // Workaround NS_AVAILABLE being used in enums, by disabling entirely :(
  17. #undef NS_AVAILABLE
  18. #define NS_AVAILABLE(osx, ios)
  19. #endif