RSSKit 0.6.1

- Main Page
- Related Pages
- Classes
- Files

- File List

GNUstep.h
1 /* GNUstep.h - macros to make easier to port gnustep apps to macos-x
2 Copyright (C) 2001 Free Software Foundation, Inc.
3
4 Written by: Nicola Pero <n.pero@mi.flashnet.it>
5 Date: March, October 2001
6
7 This file is part of GNUstep.
8
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.
13
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.
18
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.
22 */
23
24 #ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_
25 #define __GNUSTEP_GNUSTEP_H_INCLUDED_
26
27 #ifndef GNUSTEP
28
29 #if !defined( MAC_OS_X_VERSION_10_5 )
30 #define NSUInteger unsigned
31 #endif
32
33 #define AUTORELEASE(object) [object autorelease]
34 #define TEST_AUTORELEASE(object) ({ if (object) [object autorelease]; })
35
36 #define RELEASE(object) [object release]
37 #define TEST_RELEASE(object) ({ if (object) [object release]; })
38
39 #define RETAIN(object) [object retain]
40 #define TEST_RETAIN(object) ({ if (object) [object retain]; })
41
42 #define ASSIGN(object,value) ({\
43 id __value = (id)(value); \
44 id __object = (id)(object); \
45 if (__value != __object) \
46 { \
47 if (__value != nil) \
48 { \
49 [__value retain]; \
50 } \
51 object = __value; \
52 if (__object != nil) \
53 { \
54 [__object release]; \
55 } \
56 } \
57 })
58
59 #define ASSIGNCOPY(object,value) ASSIGN(object, [[value copy] autorelease]);
60
61 #define DESTROY(object) ({ \
62 if (object) \
63 { \
64 id __o = object; \
65 object = nil; \
66 [__o release]; \
67 } \
68 })
69
70 #define CREATE_AUTORELEASE_POOL(X) \
71 NSAutoreleasePool *(X) = [NSAutoreleasePool new]
72
73 #define NSLocalizedString(key, comment) \
74 [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
75
76 #define _(X) NSLocalizedString (X, nil)
77 #define __(X) X
78
79 #define NSLocalizedStaticString(X, Y) X
80
81 #endif /* GNUSTEP */
82
83 #endif /* __GNUSTEP_GNUSTEP_H_INCLUDED_ */