Export capabilities for associated references and GC.

This commit is contained in:
theraven 2011-07-19 12:34:20 +00:00
parent 2d493697a6
commit ffc661fe5c
2 changed files with 15 additions and 0 deletions

4
caps.c
View File

@ -15,6 +15,7 @@ static const int32_t caps =
(1<<OBJC_DEVELOPER_MODE) | (1<<OBJC_DEVELOPER_MODE) |
(1<<OBJC_CAP_REGISTERED_COMPATIBILITY_ALIASES) | (1<<OBJC_CAP_REGISTERED_COMPATIBILITY_ALIASES) |
(1<<OBJC_CAP_ARC) | (1<<OBJC_CAP_ARC) |
(1<<OBJC_CAP_ASSOCIATED_REFERENCES) |
#ifndef NO_OBJCXX #ifndef NO_OBJCXX
(1<<OBJC_UNIFIED_EXCEPTION_MODEL) | (1<<OBJC_UNIFIED_EXCEPTION_MODEL) |
#endif #endif
@ -23,6 +24,9 @@ static const int32_t caps =
#endif #endif
#ifdef __OBJC_LOW_MEMORY__ #ifdef __OBJC_LOW_MEMORY__
(1<<OBJC_CAP_LOW_MEMORY) | (1<<OBJC_CAP_LOW_MEMORY) |
#endif
#ifdef ENABLE_GC
(1<<OBJC_CAP_GARBAGE_COLLECTION) |
#endif #endif
0; 0;

View File

@ -85,6 +85,17 @@ extern "C" {
* __weak references. * __weak references.
*/ */
#define OBJC_CAP_ARC 11 #define OBJC_CAP_ARC 11
/**
* The runtime has support for garbage collection, as introduced by OS X 10.5.
* This includes implementations of a set of write barrier functions.
*/
#define OBJC_CAP_GARBAGE_COLLECTION 12
/**
* The runtime has support for associated references, as introduced with OS X
* 10.6. The objc_setAssociatedObject() and objc_getAssociatedObject()
* functions are available.
*/
#define OBJC_CAP_ASSOCIATED_REFERENCES 13
/** /**
* Macro used to require the existence of a specific capability. This creates * Macro used to require the existence of a specific capability. This creates