]> err.no Git - sope/blob - sope-core/EOCoreData/common.h
Drop apache 1 build-dependency
[sope] / sope-core / EOCoreData / common.h
1 /*
2   Copyright (C) 2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with SOPE; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21
22 #ifndef __EOCoreData_COMMON_H__
23 #define __EOCoreData_COMMON_H__
24
25 #import <Foundation/Foundation.h>
26 #import <Foundation/NSObjCRuntime.h>
27
28 #include <EOControl/EOControl.h>
29
30 #import <CoreData/NSEntityDescription.h>
31 #import <CoreData/NSFetchRequest.h>
32 #import <CoreData/NSManagedObject.h>
33 #import <CoreData/NSManagedObjectContext.h>
34 #import <CoreData/NSManagedObjectModel.h>
35
36
37 #ifndef ASSIGN
38 #  define ASSIGN(object, value) \
39        ({id __object = (id)object;    \
40          id __value = (id)value;      \
41          if (__value != __object) { if (__value) [__value retain]; \
42           if (__object) [__object release]; \
43           object = __value;}})
44 #endif
45 #ifndef ASSIGNCOPY
46 #  define ASSIGNCOPY(object, value) \
47        ({id __object = (id)object;    \
48          id __value = (id)value;      \
49          if (__value != __object) { if (__value) __value = [__value copy];   \
50           if (__object) [__object release]; \
51           object = __value;}})
52 #endif
53
54
55 #if GNU_RUNTIME
56 #  include <objc/objc.h>
57 #endif
58
59 #ifndef SEL_EQ
60 #  if GNU_RUNTIME
61 #    define SEL_EQ(sel1,sel2) sel_eq(sel1,sel2)
62 #  else
63 #    define SEL_EQ(sel1,sel2) (sel1 == sel2)
64 #  endif
65 #endif
66
67 #endif /* __EOCoreData_COMMON_H__ */