From f096436acc4c0c6968c88ca0f795bf021c83c670 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sat, 21 Jun 2008 13:57:44 +0200 Subject: Add support for compilation on Mac OS X. --- runtime-compatibility.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 runtime-compatibility.h (limited to 'runtime-compatibility.h') diff --git a/runtime-compatibility.h b/runtime-compatibility.h new file mode 100644 index 0000000..68bc7ed --- /dev/null +++ b/runtime-compatibility.h @@ -0,0 +1,23 @@ +#include + +#ifndef AUTORELEASE + +#define ASSIGN(VAR, VALUE) \ + ({ RELEASE (VAR); VAR = VALUE; RETAIN (VAR); }) + +#define ASSIGN_COPY(VAR, VALUE) \ + ({ RELEASE (VAR); VAR = [VALUE copy]; RETAIN (VAR); }) + +#define AUTORELEASE(VALUE) \ + [VALUE autorelease] + +#define DESTROY(VAR) \ + ({ RELEASE (VAR); VAR = nil; }) + +#define RELEASE(VALUE) \ + [VALUE release] + +#define RETAIN(VALUE) \ + [VALUE retain] + +#endif // !AUTORELEASE -- cgit v1.2.3