diff options
author | Edward O'Callaghan <eocallaghan@auroraux.org> | 2009-09-12 15:47:39 +0000 |
---|---|---|
committer | Edward O'Callaghan <eocallaghan@auroraux.org> | 2009-09-12 15:47:39 +0000 |
commit | 09870645031d5a05c7c3b9a66a53348a0d82ae52 (patch) | |
tree | 7beefb79a8ff14bd0f7e58b0b75d8c8db0e7ddd6 /BlocksRuntime/Block.h | |
parent | e80e978d6aa211056beddf4582390e374d1935ab (diff) | |
download | compiler-rt-09870645031d5a05c7c3b9a66a53348a0d82ae52.tar.gz compiler-rt-09870645031d5a05c7c3b9a66a53348a0d82ae52.tar.bz2 compiler-rt-09870645031d5a05c7c3b9a66a53348a0d82ae52.tar.xz |
Generalize Blocks code and intergrate with cmake build system more.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@81613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'BlocksRuntime/Block.h')
-rw-r--r-- | BlocksRuntime/Block.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/BlocksRuntime/Block.h b/BlocksRuntime/Block.h index 406e2b3d..477040c7 100644 --- a/BlocksRuntime/Block.h +++ b/BlocksRuntime/Block.h @@ -33,26 +33,31 @@ # endif #endif +#include <config.h> + +#if defined( HAVE_AVAILABILITY_MACROS_H ) && defined( HAVE_TARGET_CONDITIONALS_H ) #include <AvailabilityMacros.h> #include <TargetConditionals.h> +#endif /* HAVE_AVAILABILITY_MACROS_H and HAVE_TARGET_CONDITIONALS_H. */ #if __cplusplus extern "C" { #endif -// Create a heap based copy of a Block or simply add a reference to an existing one. -// This must be paired with Block_release to recover memory, even when running -// under Objective-C Garbage Collection. +/* Create a heap based copy of a Block or simply add a reference to an existing one. + * This must be paired with Block_release to recover memory, even when running + * under Objective-C Garbage Collection. + */ BLOCK_EXPORT void *_Block_copy(const void *aBlock); -// Lose the reference, and if heap based and last reference, recover the memory +/* Lose the reference, and if heap based and last reference, recover the memory. */ BLOCK_EXPORT void _Block_release(const void *aBlock); #if __cplusplus } #endif -// Type correct macros +/* Type correct macros. */ #define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__))) #define Block_release(...) _Block_release((const void *)(__VA_ARGS__)) |