1 /* 2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 3 * Use is subject to license terms. 4 */ 5 6 /* 7 * Copyright 1994, 1995, 1996 James Clark 8 * See the file COPYING for copying permission. 9 */ 10 11 #pragma ident "%Z%%M% %I% %E% SMI" 12 13 #ifndef _CONFIG_H 14 #define _CONFIG_H 15 16 #ifndef config_INCLUDED 17 #define config_INCLUDED 1 18 19 #define SP_INCLUDE_UNISTD_H 20 #define SP_POSIX_FILENAMES 21 22 #ifdef __GNUG__ 23 // It's not missing, but it pulls in libg++ 24 #define SP_NEW_H_MISSING 25 #ifndef SP_MANUAL_INST 26 #define SP_MANUAL_INST 27 #endif 28 #ifndef SP_ANSI_CLASS_INST 29 #define SP_ANSI_CLASS_INST 30 #endif 31 #ifndef SP_HAVE_BOOL 32 #define SP_HAVE_BOOL 33 #endif 34 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) 35 #define SP_ANSI_FOR_SCOPE 36 #endif 37 38 #endif /* __GNUG__ */ 39 40 #if defined(sun) || defined(__sun) 41 // struct stat has st_blksize member 42 #define SP_STAT_BLKSIZE 43 #endif 44 45 #ifdef __MACH__ 46 #define SP_MUTEX_MACH 47 #endif 48 49 #ifdef __EMX__ 50 // EMX 0.9a for OS/2 51 #undef SP_POSIX_FILENAMES 52 #define SP_MSDOS_FILENAMES 53 #endif 54 55 #ifdef _MSC_VER 56 // Microsoft Visual C++ 4.0 57 #undef SP_INCLUDE_UNISTD_H 58 #define SP_INCLUDE_IO_H 59 #ifndef SP_ANSI_CLASS_INST 60 #define SP_ANSI_CLASS_INST 61 #endif 62 #undef SP_POSIX_FILENAMES 63 #define SP_MSDOS_FILENAMES 64 #define SP_SHORT_HEADERS 65 #pragma warning(disable : 4660) // already instantiated 66 #pragma warning(disable : 4661) // missing def for decl member 67 #pragma warning(disable : 4786) // debug symbol truncated (>255 chars) 68 #pragma warning(disable : 4018) // signed/unsigned mismatch 69 #pragma warning(disable : 4251) // __declspec(dllexport) 70 #pragma warning(disable : 4275) 71 #pragma warning(disable : 4237) // future reserved keyword 72 #define huge verybig 73 #if _MSC_VER == 900 74 #define SP_DECLARE_PLACEMENT_OPERATOR_NEW 75 #endif 76 #define set_new_handler _set_new_handler 77 // Function passed to set_new_handler() returns int and takes size_t argument. 78 #define SP_FANCY_NEW_HANDLER 79 80 #if _MSC_VER >= 1100 81 // Visual C++ 5.0 82 #define SP_HAVE_BOOL 83 #define SP_SIZEOF_BOOL_1 84 #pragma warning(disable : 4800) // forcing value to bool 'true' or 85 // 'false' (performance warning) 86 #endif 87 88 #define SP_HAVE_SETMODE 89 #define SP_DLLEXPORT __declspec(dllexport) 90 #define SP_DLLIMPORT __declspec(dllimport) 91 92 #ifdef _DLL 93 #define SP_USE_DLL 94 #endif 95 96 #ifdef SP_USE_DLL 97 #ifndef BUILD_LIBSP 98 // It's not possible to export templates using __declspec(dllexport), 99 // so instead we include the template definitions in the headers, 100 // which allows Visual C++ to instantiate any needed templates 101 // in the client. 102 #define SP_DEFINE_TEMPLATES 103 #endif 104 #endif /* SP_USE_DLL */ 105 106 #ifndef SP_MANUAL_INST 107 #ifndef SP_DEFINE_TEMPLATES 108 #define SP_MANUAL_INST 109 #endif 110 #endif /* not SP_MANUAL_INST */ 111 112 #ifdef SP_MULTI_BYTE 113 #define SP_WIDE_SYSTEM 114 #endif 115 116 // wchar_t's base type is an unsigned short 117 #define SP_WCHAR_T_USHORT 118 119 // Enable precompiled header support. 120 #define SP_PCH 121 // Don't compile in message text. 122 #define SP_NO_MESSAGE_TEXT 123 #ifdef _MT 124 // Use Win32 critical section facilities 125 #define SP_MUTEX_WIN32 126 // Use the new Standard C++ library 127 #define SP_ANSI_LIB 128 #if _MSC_VER < 1100 129 // Versions prior to 5.0 don't use the std namespace 130 #define SP_NO_STD_NAMESPACE 131 #endif 132 #endif /* _MT */ 133 #endif /* _MSC_VER */ 134 135 #ifdef __WATCOMC__ 136 // Watcom C++ 10.0a 137 #define SP_MANUAL_INST 138 #undef SP_POSIX_FILENAMES 139 #define SP_MSDOS_FILENAMES 140 #undef SP_INCLUDE_UNISTD_H 141 #define SP_INCLUDE_IO_H 142 #pragma warning 004 9 143 #undef huge 144 // Cannot handle T::~T in template. 145 #define SP_QUAL_TEMPLATE_DTOR_BROKEN 146 #define SP_HAVE_SETMODE 147 #define _setmode setmode 148 #if __WATCOMC__ < 1050 149 #define _O_BINARY O_BINARY 150 #endif 151 #define SP_WCHAR_T_USHORT 152 #if __WATCOMC__ >= 1100 153 #define SP_HAVE_BOOL 154 // #define SP_SIZEOF_BOOL_1 155 #endif 156 #endif /* __WATCOMC__ */ 157 158 #ifdef __BORLANDC__ 159 // Borland C++ 5.0 160 #define SP_ANSI_FOR_SCOPE 161 #define SP_HAVE_RTTI 162 #define SP_HAVE_SETMODE 163 #undef SP_INCLUDE_UNISTD_H 164 #define SP_INCLUDE_IO_H 165 #undef SP_POSIX_FILENAMES 166 #define SP_MSDOS_FILENAMES 167 #define SP_HAVE_BOOL 168 #define SP_SHORT_HEADERS 169 #define _O_BINARY O_BINARY 170 #define _setmode setmode 171 #define SP_ANSI_CLASS_INST 172 #define SP_MANUAL_INST 173 // Building as a DLL doesn't work with Borland C++ yet. 174 #define SP_DLLEXPORT __declspec(dllexport) 175 #define SP_DLLIMPORT __declspec(dllimport) 176 #ifdef SP_USE_DLL 177 #ifndef BUILD_LIBSP 178 #define SP_DEFINE_TEMPLATES 179 #endif 180 #endif /* SP_USE_DLL */ 181 #define SP_WCHAR_T_USHORT 182 #endif /* __BORLANDC__ */ 183 184 #ifdef __IBMCPP__ 185 // IBM CSet++ 2.1 from Horst Szillat <szillat@berlin.snafu.de>. 186 #undef SP_POSIX_FILENAMES 187 #define SP_MANUAL_INST 188 #define SP_SHORT_HEADERS 189 #define SP_MSDOS_FILENAMES 190 #undef SP_INCLUDE_UNISTD_H 191 #define SP_INCLUDE_IO_H 192 #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG) 193 #endif 194 195 #ifdef __xlC__ 196 // IBM CSet++ 3.1 on AIX 4.1. 197 // Use CXX=xlC and CC=xlC in the Makefile. 198 // Note that -g creates massive executables and that -O 199 // takes ages to compile and creates core dumping executables! 200 // I havn't tried the socket stuff. 201 // <Chris_Paulson-Ellis@3mail.3com.com> 202 #define SP_MANUAL_INST 203 #define SP_HAVE_LOCALE 204 #define SP_STAT_BLKSIZE 205 #endif /* __xlC__ */ 206 207 #ifdef macintosh 208 // Apple MacOS. Tested only with Metrowerks CW10. 209 // From Ashley Colin Yakeley <AshleyB@halcyon.com> 210 #undef SP_POSIX_FILENAMES 211 #define SP_MAC_FILENAMES 212 #define SP_LINE_TERM1 '\r' 213 214 #ifdef __MWERKS__ 215 // Metrowerks for some platform (MacOS in this case) 216 217 #pragma mpwc_newline off 218 #define SP_DEFINE_TEMPLATES 219 // #define SP_USE_DLL -- __declspec doesn't work with classes (yet) 220 #ifdef SP_USE_DLL 221 #define SP_DLLEXPORT __declspec(export) 222 #define SP_DLLIMPORT __declspec(import) 223 #endif // SP_USE_DLL 224 225 #if __MWERKS__ >= 0x1000 226 // bool option only defined for CW10 and later (note __MWERKS__ is BCD) 227 #if __option(bool) 228 #define SP_HAVE_BOOL 229 #endif // __option(bool) 230 #endif // __MWERKS__ >= 0x1000 231 #endif // __MWERKS__ 232 233 #if ('\n' != 10) || ('\r' != 13) 234 #error "newlines incorrect" 235 #endif 236 237 #endif /* macintosh */ 238 239 #ifdef SP_HAVE_SETMODE 240 #ifndef SP_LINE_TERM1 241 #define SP_LINE_TERM1 '\r' 242 #define SP_LINE_TERM2 '\n' 243 #endif 244 #endif /* not SP_HAVE_SETMODE */ 245 246 #ifndef SP_LINE_TERM1 247 #define SP_LINE_TERM1 '\n' 248 #endif 249 250 #ifndef SP_ANSI_FOR_SCOPE 251 // This simulates the new ANSI "for" scope rules 252 #define for if (0); else for 253 #endif 254 255 #ifndef SP_DLLEXPORT 256 #define SP_DLLEXPORT /* as nothing */ 257 #endif 258 259 #ifndef SP_DLLIMPORT 260 #define SP_DLLIMPORT /* as nothing */ 261 #endif 262 263 #ifdef SP_USE_DLL 264 265 #ifdef BUILD_LIBSP 266 #define SP_API SP_DLLEXPORT 267 #else 268 #define SP_API SP_DLLIMPORT 269 #endif 270 271 #else /* not SP_USE_DLL */ 272 273 #define SP_API /* as nothing */ 274 275 #endif /* not SP_USE_DLL */ 276 277 // SP_WIDE_SYSTEM says that your OS provides wide character interfaces 278 // SP_WIDE_SYSTEM currently works only with Visual C++ and Windows NT/95 279 // SP_WIDE_SYSTEM implies SP_MULTI_BYTE 280 #ifdef SP_WIDE_SYSTEM 281 #ifndef SP_MULTI_BYTE 282 #define SP_MULTI_BYTE 283 #endif 284 #endif 285 286 #ifdef SP_NAMESPACE 287 #define SP_NAMESPACE_SCOPE SP_NAMESPACE:: 288 #else 289 #define SP_NAMESPACE_SCOPE 290 #endif 291 #ifdef __GNUC__ 292 using namespace std; 293 #endif 294 295 296 #endif /* not config_INCLUDED */ 297 298 #endif /* _CONFIG_H */ 299