summaryrefslogtreecommitdiff
path: root/runtime-compatibility.h
blob: 68bc7eda65b84e454b2f1e38d6dfff3b1c55482f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <Foundation/NSObject.h>

#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