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 #if __GNU_LIBOBJC__ >= 20100911 44 # include <objc/runtime.h> 45 #else 46 # include <objc/objc-api.h> 47 # include <objc/objc.h> 48 # include <objc/encoding.h> 49 #endif 50 #endif 51 52 #if WITH_FOUNDATION_EXT 53 #if NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY 54 # import <FoundationExt/objc-runtime.h> 55 # import <FoundationExt/DefaultScannerHandler.h> 56 # import <FoundationExt/PrintfFormatScanner.h> 57 # import <FoundationExt/GeneralExceptions.h> 58 # import <FoundationExt/MissingMethods.h> 59 # import <FoundationExt/NSException.h> 60 # import <FoundationExt/NSObjectMacros.h> 61 #endif 62 #endif 63 64 #if !LIB_FOUNDATION_LIBRARY && !NeXT_Foundation_LIBRARY 65 # define NSWillBecomeMultiThreadedNotification NSBecomingMultiThreaded 66 #endif 67 68 #ifndef ASSIGN 69 # define ASSIGN(object, value) \ 70 ({id __object = (id)object; \ 71 id __value = (id)value; \ 72 if (__value != __object) { if (__value) [__value retain]; \ 73 if (__object) [__object release]; \ 74 object = __value;}}) 75 #endif 76 77 #include <NGExtensions/NGExtensions.h> 78 79 /* system config */ 80 81 #if !defined(__CYGWIN32__) 82 # ifdef HAVE_WINDOWS_H 83 # include <windows.h> 84 # endif 85 # ifdef HAVE_WINSOCK_H 86 # include <winsock.h> 87 # endif 88 #endif 89 90 #ifdef HAVE_STRING_H 91 # include <string.h> 92 #endif 93 #ifdef HAVE_STRINGS_H 94 # include <strings.h> 95 #endif 96 97 #if HAVE_SYS_TYPES_H 98 # include <sys/types.h> 99 #endif 100 101 #ifndef __MINGW32__ 102 # include <netinet/in.h> 103 #endif 104 105 #ifdef HAVE_SYS_SOCKET_H 106 # include <sys/socket.h> 107 #endif 108 #ifdef HAVE_NETDB_H 109 # include <netdb.h> 110 #endif 111 112 #if !defined(WIN32) || defined(__CYGWIN32__) 113 # include <netinet/in.h> 114 # include <arpa/inet.h> 115 # include <sys/un.h> 116 #endif 117 118 #ifndef AF_LOCAL 119 # define AF_LOCAL AF_UNIX 120 #endif 121 122 #if !defined(SHUT_RD) 123 # define SHUT_RD 0 124 #endif 125 #if !defined(SHUT_WR) 126 # define SHUT_WR 1 127 #endif 128 #if !defined(SHUT_RDWR) 129 # define SHUT_RDWR 2 130 #endif 131 132 // local common's 133 134 #include <NGStreams/NGStreamExceptions.h> 135 136 @interface NSObject(OSXHacks) 137 - (void)subclassResponsibility:(SEL)_acmd; 138 - (void)notImplemented:(SEL)_acmd; 139 @end 140 141 #endif /* __NGStreams_common_H__ */ 142