]> err.no Git - sope/blob - sope-core/NGStreams/common.h
fixed some NGMail framework build issue
[sope] / sope-core / NGStreams / common.h
1 /*
2   Copyright (C) 2000-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 __NGStreams_common_H__
23 #define __NGStreams_common_H__
24
25 // common include files
26
27 #include  <Foundation/Foundation.h>
28
29 // configuration
30
31 #include "config.h"
32
33 #if defined(WIN32)
34 #  include <windows.h>
35 #  include <winsock.h>
36 #endif
37
38 #if LIB_FOUNDATION_BOEHM_GC
39 #  include <gc.h>
40 #endif
41
42 #ifdef GNU_RUNTIME
43 #  include <objc/objc-api.h>
44 #  include <objc/objc.h>
45 #  include <objc/encoding.h>
46 #endif
47
48 #if WITH_FOUNDATION_EXT
49 #if NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY
50 #  import <FoundationExt/objc-runtime.h>
51 #  import <FoundationExt/DefaultScannerHandler.h>
52 #  import <FoundationExt/PrintfFormatScanner.h>
53 #  import <FoundationExt/GeneralExceptions.h>
54 #  import <FoundationExt/MissingMethods.h>
55 #  import <FoundationExt/NSException.h>
56 #  import <FoundationExt/NSObjectMacros.h>
57 #endif
58 #endif
59
60 #if !LIB_FOUNDATION_LIBRARY && !NeXT_Foundation_LIBRARY
61 #  define NSWillBecomeMultiThreadedNotification NSBecomingMultiThreaded
62 #endif
63
64 #ifndef ASSIGN
65 #  define ASSIGN(object, value) \
66        ({id __object = (id)object;    \
67          id __value = (id)value;      \
68          if (__value != __object) { if (__value) [__value retain]; \
69           if (__object) [__object release]; \
70           object = __value;}})
71 #endif
72
73 #include <NGExtensions/NGExtensions.h>
74
75 /* system config */
76
77 #if !defined(__CYGWIN32__)
78 #  ifdef HAVE_WINDOWS_H
79 #    include <windows.h>
80 #  endif
81 #  ifdef HAVE_WINSOCK_H
82 #    include <winsock.h>
83 #  endif
84 #endif
85
86 #ifdef HAVE_STRING_H
87 #  include <string.h>
88 #endif
89 #ifdef HAVE_STRINGS_H
90 #  include <strings.h>
91 #endif
92
93 #if HAVE_SYS_TYPES_H
94 #  include <sys/types.h>
95 #endif
96
97 #ifndef __MINGW32__
98 #  include <netinet/in.h>
99 #endif
100
101 #ifdef HAVE_SYS_SOCKET_H
102 #  include <sys/socket.h>
103 #endif
104 #ifdef HAVE_NETDB_H
105 #  include <netdb.h>
106 #endif
107
108 #if !defined(WIN32) || defined(__CYGWIN32__)
109 #  include <arpa/inet.h>
110 #  include <sys/un.h>
111 #endif
112
113 #ifndef AF_LOCAL
114 #  define AF_LOCAL AF_UNIX
115 #endif
116
117 #if !defined(SHUT_RD)
118 #  define SHUT_RD   0
119 #endif
120 #if !defined(SHUT_WR)
121 #  define SHUT_WR   1
122 #endif
123 #if !defined(SHUT_RDWR)
124 #  define SHUT_RDWR 2
125 #endif
126
127 // local common's
128
129 #include <NGStreams/NGStreamExceptions.h>
130
131 @interface NSObject(OSXHacks)
132 - (void)subclassResponsibility:(SEL)_acmd;
133 - (void)notImplemented:(SEL)_acmd;
134 @end
135
136 #endif /* __NGStreams_common_H__ */