1
/* GNUstep.h - macros to make easier to port gnustep apps to macos-x
2
Copyright (C) 2001 Free Software Foundation, Inc.
4
Written by: Nicola Pero <n.pero@mi.flashnet.it>
5
Date: March, October 2001
7
This file is part of GNUstep.
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Library General Public
11
License as published by the Free Software Foundation; either
12
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public
20
License along with this library; if not, write to the Free
21
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
#ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_
25
#define __GNUSTEP_GNUSTEP_H_INCLUDED_
29
#define AUTORELEASE(object) [object autorelease]
30
#define TEST_AUTORELEASE(object) ({ if (object) [object autorelease]; })
32
#define RELEASE(object) [object release]
33
#define TEST_RELEASE(object) ({ if (object) [object release]; })
35
#define RETAIN(object) [object retain]
36
#define TEST_RETAIN(object) ({ if (object) [object retain]; })
38
#define ASSIGN(object,value) ({\
39
id __value = (id)(value); \
40
id __object = (id)(object); \
41
if (__value != __object) \
48
if (__object != nil) \
55
#define ASSIGNCOPY(object,value) ASSIGN(object, [[value copy] autorelease]);
57
#define DESTROY(object) ({ \
66
#define CREATE_AUTORELEASE_POOL(X) \
67
NSAutoreleasePool *(X) = [NSAutoreleasePool new]
69
#define NSLocalizedString(key, comment) \
70
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
72
#define _(X) NSLocalizedString (X, nil)
75
#define NSLocalizedStaticString(X, Y) X
79
#endif /* __GNUSTEP_GNUSTEP_H_INCLUDED_ */