1*396Sts27758 /* 2*396Sts27758 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 3*396Sts27758 * Use is subject to license terms. 4*396Sts27758 */ 5*396Sts27758 6*396Sts27758 /* 7*396Sts27758 * Copyright 1994, 1995, 1996 James Clark 8*396Sts27758 * See the file COPYING for copying permission. 9*396Sts27758 */ 10*396Sts27758 110Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 120Sstevel@tonic-gate 13*396Sts27758 #ifndef _CONFIG_H 14*396Sts27758 #define _CONFIG_H 15*396Sts27758 160Sstevel@tonic-gate #ifndef config_INCLUDED 17*396Sts27758 #define config_INCLUDED 1 180Sstevel@tonic-gate 19*396Sts27758 #define SP_INCLUDE_UNISTD_H 20*396Sts27758 #define SP_POSIX_FILENAMES 210Sstevel@tonic-gate 220Sstevel@tonic-gate #ifdef __GNUG__ 230Sstevel@tonic-gate // It's not missing, but it pulls in libg++ 24*396Sts27758 #define SP_NEW_H_MISSING 250Sstevel@tonic-gate #ifndef SP_MANUAL_INST 26*396Sts27758 #define SP_MANUAL_INST 270Sstevel@tonic-gate #endif 280Sstevel@tonic-gate #ifndef SP_ANSI_CLASS_INST 29*396Sts27758 #define SP_ANSI_CLASS_INST 300Sstevel@tonic-gate #endif 310Sstevel@tonic-gate #ifndef SP_HAVE_BOOL 32*396Sts27758 #define SP_HAVE_BOOL 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) 35*396Sts27758 #define SP_ANSI_FOR_SCOPE 360Sstevel@tonic-gate #endif 370Sstevel@tonic-gate 380Sstevel@tonic-gate #endif /* __GNUG__ */ 390Sstevel@tonic-gate 400Sstevel@tonic-gate #if defined(sun) || defined(__sun) 410Sstevel@tonic-gate // struct stat has st_blksize member 42*396Sts27758 #define SP_STAT_BLKSIZE 430Sstevel@tonic-gate #endif 440Sstevel@tonic-gate 450Sstevel@tonic-gate #ifdef __MACH__ 46*396Sts27758 #define SP_MUTEX_MACH 470Sstevel@tonic-gate #endif 480Sstevel@tonic-gate 490Sstevel@tonic-gate #ifdef __EMX__ 500Sstevel@tonic-gate // EMX 0.9a for OS/2 510Sstevel@tonic-gate #undef SP_POSIX_FILENAMES 52*396Sts27758 #define SP_MSDOS_FILENAMES 530Sstevel@tonic-gate #endif 540Sstevel@tonic-gate 550Sstevel@tonic-gate #ifdef _MSC_VER 560Sstevel@tonic-gate // Microsoft Visual C++ 4.0 570Sstevel@tonic-gate #undef SP_INCLUDE_UNISTD_H 58*396Sts27758 #define SP_INCLUDE_IO_H 590Sstevel@tonic-gate #ifndef SP_ANSI_CLASS_INST 60*396Sts27758 #define SP_ANSI_CLASS_INST 610Sstevel@tonic-gate #endif 620Sstevel@tonic-gate #undef SP_POSIX_FILENAMES 63*396Sts27758 #define SP_MSDOS_FILENAMES 64*396Sts27758 #define SP_SHORT_HEADERS 65*396Sts27758 #pragma warning(disable : 4660) // already instantiated 66*396Sts27758 #pragma warning(disable : 4661) // missing def for decl member 67*396Sts27758 #pragma warning(disable : 4786) // debug symbol truncated (>255 chars) 68*396Sts27758 #pragma warning(disable : 4018) // signed/unsigned mismatch 69*396Sts27758 #pragma warning(disable : 4251) // __declspec(dllexport) 70*396Sts27758 #pragma warning(disable : 4275) 71*396Sts27758 #pragma warning(disable : 4237) // future reserved keyword 72*396Sts27758 #define huge verybig 730Sstevel@tonic-gate #if _MSC_VER == 900 74*396Sts27758 #define SP_DECLARE_PLACEMENT_OPERATOR_NEW 750Sstevel@tonic-gate #endif 76*396Sts27758 #define set_new_handler _set_new_handler 770Sstevel@tonic-gate // Function passed to set_new_handler() returns int and takes size_t argument. 78*396Sts27758 #define SP_FANCY_NEW_HANDLER 790Sstevel@tonic-gate 800Sstevel@tonic-gate #if _MSC_VER >= 1100 810Sstevel@tonic-gate // Visual C++ 5.0 82*396Sts27758 #define SP_HAVE_BOOL 83*396Sts27758 #define SP_SIZEOF_BOOL_1 84*396Sts27758 #pragma warning(disable : 4800) // forcing value to bool 'true' or 85*396Sts27758 // 'false' (performance warning) 860Sstevel@tonic-gate #endif 870Sstevel@tonic-gate 88*396Sts27758 #define SP_HAVE_SETMODE 89*396Sts27758 #define SP_DLLEXPORT __declspec(dllexport) 90*396Sts27758 #define SP_DLLIMPORT __declspec(dllimport) 910Sstevel@tonic-gate 920Sstevel@tonic-gate #ifdef _DLL 93*396Sts27758 #define SP_USE_DLL 940Sstevel@tonic-gate #endif 950Sstevel@tonic-gate 960Sstevel@tonic-gate #ifdef SP_USE_DLL 970Sstevel@tonic-gate #ifndef BUILD_LIBSP 980Sstevel@tonic-gate // It's not possible to export templates using __declspec(dllexport), 990Sstevel@tonic-gate // so instead we include the template definitions in the headers, 1000Sstevel@tonic-gate // which allows Visual C++ to instantiate any needed templates 1010Sstevel@tonic-gate // in the client. 102*396Sts27758 #define SP_DEFINE_TEMPLATES 1030Sstevel@tonic-gate #endif 1040Sstevel@tonic-gate #endif /* SP_USE_DLL */ 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate #ifndef SP_MANUAL_INST 1070Sstevel@tonic-gate #ifndef SP_DEFINE_TEMPLATES 108*396Sts27758 #define SP_MANUAL_INST 1090Sstevel@tonic-gate #endif 1100Sstevel@tonic-gate #endif /* not SP_MANUAL_INST */ 1110Sstevel@tonic-gate 1120Sstevel@tonic-gate #ifdef SP_MULTI_BYTE 113*396Sts27758 #define SP_WIDE_SYSTEM 1140Sstevel@tonic-gate #endif 1150Sstevel@tonic-gate 1160Sstevel@tonic-gate // wchar_t's base type is an unsigned short 117*396Sts27758 #define SP_WCHAR_T_USHORT 1180Sstevel@tonic-gate 1190Sstevel@tonic-gate // Enable precompiled header support. 120*396Sts27758 #define SP_PCH 1210Sstevel@tonic-gate // Don't compile in message text. 122*396Sts27758 #define SP_NO_MESSAGE_TEXT 1230Sstevel@tonic-gate #ifdef _MT 1240Sstevel@tonic-gate // Use Win32 critical section facilities 125*396Sts27758 #define SP_MUTEX_WIN32 1260Sstevel@tonic-gate // Use the new Standard C++ library 127*396Sts27758 #define SP_ANSI_LIB 1280Sstevel@tonic-gate #if _MSC_VER < 1100 1290Sstevel@tonic-gate // Versions prior to 5.0 don't use the std namespace 130*396Sts27758 #define SP_NO_STD_NAMESPACE 1310Sstevel@tonic-gate #endif 1320Sstevel@tonic-gate #endif /* _MT */ 1330Sstevel@tonic-gate #endif /* _MSC_VER */ 1340Sstevel@tonic-gate 1350Sstevel@tonic-gate #ifdef __WATCOMC__ 1360Sstevel@tonic-gate // Watcom C++ 10.0a 137*396Sts27758 #define SP_MANUAL_INST 1380Sstevel@tonic-gate #undef SP_POSIX_FILENAMES 139*396Sts27758 #define SP_MSDOS_FILENAMES 1400Sstevel@tonic-gate #undef SP_INCLUDE_UNISTD_H 141*396Sts27758 #define SP_INCLUDE_IO_H 1420Sstevel@tonic-gate #pragma warning 004 9 1430Sstevel@tonic-gate #undef huge 1440Sstevel@tonic-gate // Cannot handle T::~T in template. 145*396Sts27758 #define SP_QUAL_TEMPLATE_DTOR_BROKEN 146*396Sts27758 #define SP_HAVE_SETMODE 147*396Sts27758 #define _setmode setmode 1480Sstevel@tonic-gate #if __WATCOMC__ < 1050 149*396Sts27758 #define _O_BINARY O_BINARY 1500Sstevel@tonic-gate #endif 151*396Sts27758 #define SP_WCHAR_T_USHORT 1520Sstevel@tonic-gate #if __WATCOMC__ >= 1100 153*396Sts27758 #define SP_HAVE_BOOL 1540Sstevel@tonic-gate // #define SP_SIZEOF_BOOL_1 1550Sstevel@tonic-gate #endif 1560Sstevel@tonic-gate #endif /* __WATCOMC__ */ 1570Sstevel@tonic-gate 1580Sstevel@tonic-gate #ifdef __BORLANDC__ 1590Sstevel@tonic-gate // Borland C++ 5.0 160*396Sts27758 #define SP_ANSI_FOR_SCOPE 161*396Sts27758 #define SP_HAVE_RTTI 162*396Sts27758 #define SP_HAVE_SETMODE 1630Sstevel@tonic-gate #undef SP_INCLUDE_UNISTD_H 164*396Sts27758 #define SP_INCLUDE_IO_H 1650Sstevel@tonic-gate #undef SP_POSIX_FILENAMES 166*396Sts27758 #define SP_MSDOS_FILENAMES 167*396Sts27758 #define SP_HAVE_BOOL 168*396Sts27758 #define SP_SHORT_HEADERS 169*396Sts27758 #define _O_BINARY O_BINARY 170*396Sts27758 #define _setmode setmode 171*396Sts27758 #define SP_ANSI_CLASS_INST 172*396Sts27758 #define SP_MANUAL_INST 1730Sstevel@tonic-gate // Building as a DLL doesn't work with Borland C++ yet. 174*396Sts27758 #define SP_DLLEXPORT __declspec(dllexport) 175*396Sts27758 #define SP_DLLIMPORT __declspec(dllimport) 1760Sstevel@tonic-gate #ifdef SP_USE_DLL 1770Sstevel@tonic-gate #ifndef BUILD_LIBSP 178*396Sts27758 #define SP_DEFINE_TEMPLATES 1790Sstevel@tonic-gate #endif 1800Sstevel@tonic-gate #endif /* SP_USE_DLL */ 181*396Sts27758 #define SP_WCHAR_T_USHORT 1820Sstevel@tonic-gate #endif /* __BORLANDC__ */ 1830Sstevel@tonic-gate 1840Sstevel@tonic-gate #ifdef __IBMCPP__ 1850Sstevel@tonic-gate // IBM CSet++ 2.1 from Horst Szillat <szillat@berlin.snafu.de>. 1860Sstevel@tonic-gate #undef SP_POSIX_FILENAMES 187*396Sts27758 #define SP_MANUAL_INST 188*396Sts27758 #define SP_SHORT_HEADERS 189*396Sts27758 #define SP_MSDOS_FILENAMES 1900Sstevel@tonic-gate #undef SP_INCLUDE_UNISTD_H 191*396Sts27758 #define SP_INCLUDE_IO_H 192*396Sts27758 #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG) 1930Sstevel@tonic-gate #endif 1940Sstevel@tonic-gate 1950Sstevel@tonic-gate #ifdef __xlC__ 1960Sstevel@tonic-gate // IBM CSet++ 3.1 on AIX 4.1. 1970Sstevel@tonic-gate // Use CXX=xlC and CC=xlC in the Makefile. 1980Sstevel@tonic-gate // Note that -g creates massive executables and that -O 1990Sstevel@tonic-gate // takes ages to compile and creates core dumping executables! 2000Sstevel@tonic-gate // I havn't tried the socket stuff. 2010Sstevel@tonic-gate // <Chris_Paulson-Ellis@3mail.3com.com> 202*396Sts27758 #define SP_MANUAL_INST 203*396Sts27758 #define SP_HAVE_LOCALE 204*396Sts27758 #define SP_STAT_BLKSIZE 2050Sstevel@tonic-gate #endif /* __xlC__ */ 2060Sstevel@tonic-gate 2070Sstevel@tonic-gate #ifdef macintosh 2080Sstevel@tonic-gate // Apple MacOS. Tested only with Metrowerks CW10. 2090Sstevel@tonic-gate // From Ashley Colin Yakeley <AshleyB@halcyon.com> 2100Sstevel@tonic-gate #undef SP_POSIX_FILENAMES 211*396Sts27758 #define SP_MAC_FILENAMES 212*396Sts27758 #define SP_LINE_TERM1 '\r' 2130Sstevel@tonic-gate 2140Sstevel@tonic-gate #ifdef __MWERKS__ 2150Sstevel@tonic-gate // Metrowerks for some platform (MacOS in this case) 2160Sstevel@tonic-gate 2170Sstevel@tonic-gate #pragma mpwc_newline off 218*396Sts27758 #define SP_DEFINE_TEMPLATES 2190Sstevel@tonic-gate // #define SP_USE_DLL -- __declspec doesn't work with classes (yet) 2200Sstevel@tonic-gate #ifdef SP_USE_DLL 221*396Sts27758 #define SP_DLLEXPORT __declspec(export) 222*396Sts27758 #define SP_DLLIMPORT __declspec(import) 2230Sstevel@tonic-gate #endif // SP_USE_DLL 2240Sstevel@tonic-gate 2250Sstevel@tonic-gate #if __MWERKS__ >= 0x1000 2260Sstevel@tonic-gate // bool option only defined for CW10 and later (note __MWERKS__ is BCD) 2270Sstevel@tonic-gate #if __option(bool) 228*396Sts27758 #define SP_HAVE_BOOL 2290Sstevel@tonic-gate #endif // __option(bool) 2300Sstevel@tonic-gate #endif // __MWERKS__ >= 0x1000 2310Sstevel@tonic-gate #endif // __MWERKS__ 2320Sstevel@tonic-gate 2330Sstevel@tonic-gate #if ('\n' != 10) || ('\r' != 13) 2340Sstevel@tonic-gate #error "newlines incorrect" 2350Sstevel@tonic-gate #endif 2360Sstevel@tonic-gate 2370Sstevel@tonic-gate #endif /* macintosh */ 2380Sstevel@tonic-gate 2390Sstevel@tonic-gate #ifdef SP_HAVE_SETMODE 2400Sstevel@tonic-gate #ifndef SP_LINE_TERM1 241*396Sts27758 #define SP_LINE_TERM1 '\r' 242*396Sts27758 #define SP_LINE_TERM2 '\n' 2430Sstevel@tonic-gate #endif 2440Sstevel@tonic-gate #endif /* not SP_HAVE_SETMODE */ 2450Sstevel@tonic-gate 2460Sstevel@tonic-gate #ifndef SP_LINE_TERM1 247*396Sts27758 #define SP_LINE_TERM1 '\n' 2480Sstevel@tonic-gate #endif 2490Sstevel@tonic-gate 2500Sstevel@tonic-gate #ifndef SP_ANSI_FOR_SCOPE 2510Sstevel@tonic-gate // This simulates the new ANSI "for" scope rules 252*396Sts27758 #define for if (0); else for 2530Sstevel@tonic-gate #endif 2540Sstevel@tonic-gate 2550Sstevel@tonic-gate #ifndef SP_DLLEXPORT 256*396Sts27758 #define SP_DLLEXPORT /* as nothing */ 2570Sstevel@tonic-gate #endif 2580Sstevel@tonic-gate 2590Sstevel@tonic-gate #ifndef SP_DLLIMPORT 260*396Sts27758 #define SP_DLLIMPORT /* as nothing */ 2610Sstevel@tonic-gate #endif 2620Sstevel@tonic-gate 2630Sstevel@tonic-gate #ifdef SP_USE_DLL 2640Sstevel@tonic-gate 2650Sstevel@tonic-gate #ifdef BUILD_LIBSP 266*396Sts27758 #define SP_API SP_DLLEXPORT 2670Sstevel@tonic-gate #else 268*396Sts27758 #define SP_API SP_DLLIMPORT 2690Sstevel@tonic-gate #endif 2700Sstevel@tonic-gate 2710Sstevel@tonic-gate #else /* not SP_USE_DLL */ 2720Sstevel@tonic-gate 273*396Sts27758 #define SP_API /* as nothing */ 2740Sstevel@tonic-gate 2750Sstevel@tonic-gate #endif /* not SP_USE_DLL */ 2760Sstevel@tonic-gate 2770Sstevel@tonic-gate // SP_WIDE_SYSTEM says that your OS provides wide character interfaces 2780Sstevel@tonic-gate // SP_WIDE_SYSTEM currently works only with Visual C++ and Windows NT/95 2790Sstevel@tonic-gate // SP_WIDE_SYSTEM implies SP_MULTI_BYTE 2800Sstevel@tonic-gate #ifdef SP_WIDE_SYSTEM 2810Sstevel@tonic-gate #ifndef SP_MULTI_BYTE 282*396Sts27758 #define SP_MULTI_BYTE 2830Sstevel@tonic-gate #endif 2840Sstevel@tonic-gate #endif 2850Sstevel@tonic-gate 2860Sstevel@tonic-gate #ifdef SP_NAMESPACE 287*396Sts27758 #define SP_NAMESPACE_SCOPE SP_NAMESPACE:: 2880Sstevel@tonic-gate #else 289*396Sts27758 #define SP_NAMESPACE_SCOPE 290*396Sts27758 #endif 291*396Sts27758 #ifdef __GNUC__ 292*396Sts27758 using namespace std; 2930Sstevel@tonic-gate #endif 2940Sstevel@tonic-gate 295*396Sts27758 2960Sstevel@tonic-gate #endif /* not config_INCLUDED */ 297*396Sts27758 298*396Sts27758 #endif /* _CONFIG_H */ 299