weak.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. To test -weak-l or -weak-framework:
  3. * -DWEAK_IMPORT=
  4. * -DWEAK_FRAMEWORK=1
  5. * -UEMPTY when building the weak-not-missing library
  6. * -DEMPTY= when building the weak-missing library
  7. To test attribute((weak_import)):
  8. * -DWEAK_IMPORT=__attribute__((weak_import))
  9. * -UWEAK_FRAMEWORK
  10. * -UEMPTY when building the weak-not-missing library
  11. * -DEMPTY= when building the weak-missing library
  12. */
  13. #include "test.h"
  14. #include <objc/runtime.h>
  15. extern int state;
  16. WEAK_IMPORT OBJC_ROOT_CLASS
  17. @interface MissingRoot {
  18. id isa;
  19. }
  20. +(void) initialize;
  21. +(Class) class;
  22. +(id) alloc;
  23. -(id) init;
  24. -(void) dealloc;
  25. +(int) method;
  26. @end
  27. @interface MissingRoot (RR)
  28. -(id) retain;
  29. -(void) release;
  30. @end
  31. WEAK_IMPORT
  32. @interface MissingSuper : MissingRoot {
  33. @public
  34. int ivar;
  35. }
  36. @end
  37. OBJC_ROOT_CLASS
  38. @interface NotMissingRoot {
  39. id isa;
  40. }
  41. +(void) initialize;
  42. +(Class) class;
  43. +(id) alloc;
  44. -(id) init;
  45. -(void) dealloc;
  46. +(int) method;
  47. @end
  48. @interface NotMissingRoot (RR)
  49. -(id) retain;
  50. -(void) release;
  51. @end
  52. @interface NotMissingSuper : NotMissingRoot {
  53. @public
  54. int unused[100];
  55. int ivar;
  56. }
  57. @end