Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
config.h
Go to the documentation of this file.00001 00005 /* 00006 * Copyright © 2000-2002 Sofus Mortensen 00007 * 00008 * This material is provided "as is", with absolutely no warranty 00009 * expressed or implied. Any use is at your own risk. Permission to 00010 * use or copy this software for any purpose is hereby granted without 00011 * fee, provided the above notices are retained on all copies. 00012 * Permission to modify the code and to distribute modified code is 00013 * granted, provided the above notices are retained, and a notice that 00014 * the code was modified is included with the above copyright notice. 00015 * 00016 * This header is part of comet. 00017 * http://www.lambdasoft.dk/comet 00018 */ 00019 00020 #ifndef COMET_CONFIG_H 00021 #define COMET_CONFIG_H 00022 00023 #define COMET_MAJOR_VER 1 00024 #define COMET_BUILDTYPE beta 00025 #define COMET_MINOR_VER 31 00026 #define COMET_BUILD 20040607 00027 00028 #ifndef COMET_BUILD_VERSION_ONLY 00029 00030 #ifndef COMET_NO_DECLSPEC_PROPERTY 00031 #define COMET_ALLOW_DECLSPEC_PROPERTY 00032 #endif // COMET_NO_DECLSPEC_PROPERTY 00033 00034 #pragma warning(disable : 4786) 00035 #pragma warning(disable : 4042) 00036 #pragma warning(disable : 4290) 00037 #pragma warning(disable : 4710) 00038 00039 #ifdef _lint // PC/Lint has a few problems with comet. 00040 # if !defined(_MSC_VER) || _MSC_VER >= 1300 00041 #define COMET_PARTIAL_SPECIALISATION 00042 #else 00043 00044 #endif 00045 #define COMET_NESTED_TEMPLATES 00046 #define COMET_GOOD_RECURSIVE_STRUCT 00047 #define COMET_CONST_MEMBER_INIT 00048 #define COMET_GUID_BASE GUID 00049 #define COMET_STD_ITERATOR 00050 #define COMET_NO_POINTER_CHECKING 00051 #define COMET_STD_SWAP_NOTHROW throw() 00052 #define COMET_TL_TRUNC 00053 #else 00054 //VC 7.1 support partial specialization 00055 #ifdef _MSC_VER 00056 #endif 00057 00058 #ifdef __ICL 00059 # define COMET_PARTIAL_SPECIALISATION 00060 #else 00061 # ifdef _MSC_VER 00062 # if _MSC_VER < 1300 00063 // Versions less than VC7 can't handle the rethrow & catch exception trick. 00064 # define COMET_DISABLE_EXCEPTION_RETHROW_CATCH 00065 # else // _MSC_VER >= 1300 00066 # define COMET_GOOD_RECURSIVE_STRUCT 00067 # define COMET_CONST_MEMBER_INIT 00068 # if _MSC_VER >= 1310 00069 # define COMET_PARTIAL_SPECIALISATION 00070 # define COMET_NESTED_TEMPLATES 00071 # endif 00072 # endif 00073 00074 # endif 00075 #if defined(_UNICODE) && !defined(UNICODE) 00076 #define UNICODE 00077 #endif 00078 #endif 00079 00080 #ifdef __BORLANDC__ 00081 #pragma warning(disable: 8027) 00082 #pragma warning(disable: 8026) 00083 #define COMET_PARTIAL_SPECIALISATION 00084 #define COMET_NESTED_TEMPLATES 00085 #define COMET_BROKEN_WTYPES 00086 #define COMET_STD_ITERATOR 00087 #define COMET_STD_SWAP_NOTHROW 00088 00089 #define COMET_GUID_BASE _GUID 00090 #else 00091 #define COMET_STD_SWAP_NOTHROW throw() 00092 #define COMET_GUID_BASE GUID 00093 #endif 00094 00095 #ifdef __CYGWIN__ 00096 #define COMET_PARTIAL_SPECIALISATION 00097 #define COMET_NESTED_TEMPLATES 00098 #define COMET_GCC_HEADERS 00099 #define COMET_STD_ITERATOR 00100 #define COMET_TL_TRUNC 00101 #define _T(x) x 00102 00103 // This is not a good idea 00104 // Routines that use _alloca has to be rewritten for __MINGW32__ targets. 00105 // #define _alloca malloc 00106 00107 // WIN32 defines for GCC 00108 #define NONAMELESSUNION 00109 #define NOCOMATTRIBUTE 00110 #endif 00111 #endif 00112 00113 00114 // Use COMET_STRICT_TYPENAME only where MSVC barfs on stricter typename usage 00115 // required by GCC. 00116 #ifdef _MSC_VER 00117 #if _MSC_VER <= 1300 00118 #define COMET_STRICT_TYPENAME 00119 #else 00120 #define COMET_STRICT_TYPENAME typename 00121 #endif 00122 #else 00123 #define COMET_STRICT_TYPENAME typename 00124 #endif 00125 00126 // PRH Feb 26 2001 00127 // Try and determine which version of std::iterator we have. 00128 // The ANSI/ISO compliant one seems to require a compiler 00129 // that supports partial specialisation, as well as an 00130 // ANSI/ISO compliant implementation of the library. 00131 00132 // Unfortunately, there is no __ANSI_STL #define. 00133 // So we guess: 00134 // If we have partial specialisation, and we're using STLPort, then 00135 // its the ANSI/ISO std::iterator, otherwise it is the MSVC 6.0 00136 // iterator. 00137 00138 // If you're using some other decent STL other than STLPort, 00139 // then you'll need to reflect this by ensuring that COMET_STD_ITERATOR 00140 // is defined. 00141 00142 #if _MSC_VER >= 1300 || defined(_CPPLIB_VER) 00143 #define COMET_STD_ITERATOR 00144 #else 00145 #include <iterator> 00146 #ifdef COMET_PARTIAL_SPECIALISATION 00147 // this code to "detect" STLport is stolen from <boost/config.hpp> 00148 //#if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES) 00149 #ifdef __SGI_STL 00150 #define COMET_STD_ITERATOR 00151 #else 00152 #ifdef __MINGW32__ 00153 __STL_BEGIN_NAMESPACE 00154 template <class _Tp, class _Distance>struct iterator: bidirectional_iterator<_Tp,_Distance>{}; 00155 __STL_END_NAMESPACE 00156 #endif // __MINGW32__ 00157 #endif 00158 #else 00159 #ifdef _CPPLIB_VER 00160 #define COMET_STD_ITERATOR 00161 #endif 00162 #endif /* COMET_PARTIAL_SPECIALISATION */ 00163 #endif 00164 00165 #ifndef ATL_NO_VTABLE 00166 #if _MSC_VER >= 1200 00167 #define ATL_NO_VTABLE __declspec(novtable) 00168 #else 00169 #define ATL_NO_VTABLE 00170 #endif 00171 #endif 00172 00173 #if _MSC_VER <= 1200 00174 //#define COMET_DO_NOT_SPECIALISE_SWAP_IN_STD 00175 #endif 00176 00177 // Intel compiler version 500 sets _MSC_VER to 1200, 00178 // but doesn't seem to like __forceinline 00179 #if _MSC_VER >= 1200 && !defined(__ICL) 00180 #define COMET_FORCEINLINE __forceinline 00181 #else 00182 #define COMET_FORCEINLINE inline 00183 #endif 00184 00185 #ifdef _UNICODE 00186 #ifndef UNICODE 00187 #define UNICODE // UNICODE is used by Windows headers 00188 #endif 00189 #endif 00190 00191 #ifdef UNICODE 00192 #ifndef _UNICODE 00193 #define _UNICODE // _UNICODE is used by C-runtime/MFC headers 00194 #endif 00195 #endif 00196 00197 // Remove Microsoft's C++ profanity 00198 #undef variant_t 00199 #undef bstr_t 00200 #undef com_cast 00201 00202 // Stop subsequent includes of <comutil.h> from #defining variant_t or bstr_t 00203 #ifndef _USE_RAW 00204 #define _USE_RAW 00205 #endif 00206 00207 #ifndef UUID_DEFINED 00208 #define UUID_DEFINED 00209 #endif 00210 00211 #ifndef UUID 00212 #define UUID GUID 00213 #endif 00214 00215 #ifdef uuid_t 00216 #undef uuid_t 00217 #endif 00218 00219 #define COMET_DECLARE_SWAP(TYPE) template<> inline void swap(TYPE &x, TYPE &y)\ 00220 {\ 00221 x.swap(y);\ 00222 } 00223 00224 const unsigned short COMET_VARIANT_TRUE = (unsigned short)(0xffff); 00225 const unsigned short COMET_VARIANT_FALSE = 0; 00226 00227 #define COMET_NOTUSED(x) x 00228 #ifndef COMET_CONST_MEMBER_INIT 00229 # define COMET_CONST_TYPE(vartype, varname,value) enum { varname = value }; 00230 # define COMET_CONST_GROUP enum { 00231 # define COMET_CONST_ENTRY(vartype, varname,value) varname = value, 00232 # define COMET_CONST_GROUP_END }; 00233 #else 00234 # define COMET_CONST_TYPE(vartype, varname,value) static const vartype varname = value; 00235 # define COMET_CONST_ENTRY(vartype, varname,value) COMET_CONST_TYPE(vartype, varname, value); 00236 # define COMET_CONST_GROUP 00237 # define COMET_CONST_GROUP_END 00238 #endif 00239 #endif // COMET_BUILD_VERSION_ONLY 00240 #endif 00241