/home/ntakagi/work/STLport-5.1.5/stlport/stl/config/_evc.hGo to the documentation of this file.00001 /* 00002 * File to have Microsoft eMbedded Visual C++ 3.0 and .NET working with STLport 00003 * May 2004 00004 * Origin : Zdenek Nemec - zero@mapfactor.com 00005 * Michael Fink - vividos@users.sourceforge.net 00006 */ 00007 00008 #ifndef _STLP_EVC_H 00009 #define _STLP_EVC_H 00010 00011 #define _STLP_COMPILER "eMbedded Visual C++" 00012 00013 // This flag is being used by STLport to support 00014 // old-fashioned Windows CE SDK (see stl_wince.h) 00015 // do not use with eMebedded Visual C++ 3 or 4! 00016 #ifdef _STLP_WINCE 00017 # undef _STLP_WINCE 00018 #endif 00019 00020 /* Compiler dependent define. The following defines may be available: 00021 * _STLP_WCE_EVC3 when compiling under eMbedded Visual C++ 3 00022 * _STLP_WCE_NET when compiling under eMbedded Visual C++ .NET 00023 * _STLP_WCE always defined when compiling with one of the above 00024 */ 00025 #undef _STLP_WCE_EVC3 00026 #undef _STLP_WCE_NET 00027 00028 #if (_WIN32_WCE > 300) 00029 # define _STLP_WCE_NET UNDER_CE 00030 #elif (_WIN32_WCE == 300) 00031 # define _STLP_WCE_EVC3 UNDER_CE 00032 #else 00033 # error No support for Windows CE below 3.0! 00034 #endif 00035 00036 // This is defined for all platforms using Windows CE 00037 #define _STLP_WCE 00038 00039 /* All Windows CE versions up to at least version 5 are little-endian, even 00040 * if the hardware (like e.g. MIPS) can be configured for big-endian, too. */ 00041 #define _STLP_LITTLE_ENDIAN 00042 00043 // Ensure _DEBUG is defined. 00044 #if defined (DEBUG) && !defined (_DEBUG) 00045 # define _DEBUG 00046 #endif 00047 00048 // in evc3/4, on ARM, check that _STLP_DEBUG is not defined 00049 // the ARM compiler has a bug that prevents that debug mode from working 00050 #if _WIN32_WCE < 500 && defined(ARM) && defined(_STLP_DEBUG) 00051 # error _STLP_DEBUG mode is not supported in evc3 and evc4 on the ARM platform! 00052 #endif 00053 00054 // inherit all msvc6 options 00055 #include <stl/config/_msvc.h> 00056 00057 // CE up to at least version 5 has no C locale support 00058 #define _STLP_NO_LOCALE_SUPPORT 00059 00060 #if _WIN32_WCE >= 0x500 00061 // SDKs built with PB5 have terminate&co in namespace std... 00062 # define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_STD 00063 # define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_STD 00064 // ...and new_handler/set_new_handler in the global namespace. 00065 # define _STLP_GLOBAL_NEW_HANDLER 1 00066 #endif 00067 00068 // Always threaded in eMbedded Visual C++ 3.0 and .NET 00069 #ifndef _MT 00070 # define _MT 00071 #endif 00072 00073 // we don't have a static native runtime library 00074 #undef _STLP_USING_CROSS_NATIVE_RUNTIME_LIB 00075 00076 #if _WIN32_WCE < 400 00077 // no long double under CE3 and older 00078 # define _STLP_NO_LONG_DOUBLE 00079 #endif 00080 00081 // no *f and *l math functions available 00082 #define _STLP_NO_VENDOR_MATH_F 00083 #define _STLP_NO_VENDOR_MATH_L 00084 00085 /* 00086 * Redirect cout, cerr and clog: 00087 * If defined redirect cout, cerr and clog to 00088 * files stdout.txt, stderr.txt and stdlog.txt 00089 */ 00090 //# define _STLP_REDIRECT_STDSTREAMS 00091 00092 /* 00093 * Static class members may generate LNK1179: 00094 * Wrong COMDAT packing may cause LNK1179 error. 00095 * For details see http://groups.google.com/groups?th=8a05c82c4ffee280 00096 * example P78. This define is not used/needed at this moment 00097 * but may came handy in future... 00098 */ 00099 //# define _STLP_STATIC_MEMBERS_BUG 00100 00101 // Use wide-string interface of windows native functions (CreateFile...). 00102 // Note that this should be defined all the time while under CE. 00103 #if defined (UNICODE) 00104 # define _STLP_USE_WIDE_INTERFACE 00105 #endif 00106 00107 // Force exception std to std instead of __std_alias. 00108 #if defined (__cplusplus) && !defined (_STLP_HAS_NO_NAMESPACES) 00109 # ifdef _STLP_VENDOR_EXCEPT_STD 00110 # undef _STLP_VENDOR_EXCEPT_STD 00111 # endif 00112 # define _STLP_VENDOR_EXCEPT_STD std 00113 #endif 00114 00115 // short string optimization bug under evc3, evc4 using ARM compiler 00116 #if _MSC_VER<1400 && (defined (ARM) || defined (_ARM_)) 00117 # define _STLP_DONT_USE_SHORT_STRING_OPTIM 00118 #endif 00119 00120 // when using MFC, disable another placement new declaration, since there is one in wcealt.h 00121 #if !defined (__BUILDING_STLPORT) && defined (_MFC_VER) 00122 # define __PLACEMENT_NEW_INLINE 00123 #endif 00124 00125 // threads 00126 #undef _REENTRANT 00127 #define _REENTRANT 00128 #undef _NOTHREADS 00129 00130 // Use old fashioned headers (ctime vs. time.h). 00131 #undef _STLP_NO_NEW_C_HEADERS 00132 #define _STLP_NO_NEW_C_HEADERS 00133 00134 // exception handling support: only on evc4 and user added /GX to project settings 00135 #if defined (_STLP_WCE_EVC3) || !defined (_CPPUNWIND) 00136 # define _STLP_NO_EXCEPTION_HEADER 00137 # define _STLP_NO_EXCEPTIONS 00138 # undef _STLP_USE_EXCEPTIONS 00139 # ifndef __THROW_BAD_ALLOC 00140 # define __THROW_BAD_ALLOC { _STLP_WINCE_TRACE(L"out of memory"); ExitThread(1); } 00141 # endif 00142 #endif 00143 00144 #define _STLP_WINCE_TRACE(msg) OutputDebugString(msg) 00145 00146 /* 00147 * eMbedded Visual C++ .NET specific settings 00148 */ 00149 #if defined (_STLP_WCE_NET) 00150 00151 // evc4 has no locale and time support 00152 # define _STLP_NO_LOCALE_SUPPORT 00153 # define _STLP_NO_TIME_SUPPORT 00154 00155 // ptrdiff_t is not defined in evc4 headers 00156 # ifndef _PTRDIFF_T_DEFINED 00157 typedef int ptrdiff_t; 00158 # define _PTRDIFF_T_DEFINED 00159 # endif 00160 00161 /* 00162 * Helper macros for including the native headers in cases where a file with 00163 * the same name also exists in the STLport include folder. The idea behind 00164 * this is that we first go up one directory and then down into a dir that 00165 * is only present in the native install but not in STLport. 00166 * 00167 */ 00168 # if !defined (_STLP_NATIVE_INCLUDE_PATH) 00169 # if defined (_X86_) 00170 # if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR) 00171 # define _STLP_NATIVE_INCLUDE_PATH ../Emulator 00172 # else 00173 # define _STLP_NATIVE_INCLUDE_PATH ../X86 00174 # endif 00175 # elif defined (_ARM_) 00176 # if _MSC_VER < 1400 00177 // eVC3/4 00178 # if defined (ARMV4) 00179 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4 00180 # elif defined (ARMV4I) 00181 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4i 00182 # elif defined (ARMV4T) 00183 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4t 00184 # else 00185 # error Unknown ARM SDK. 00186 # endif 00187 # else 00188 // VC8 crosscompiling for CE 00189 # if defined (ARMV4) 00190 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4 00191 # elif defined(ARMV4I) || defined(ARMV4T) 00192 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4i 00193 # else 00194 # error Unknown ARM SDK. 00195 # endif 00196 # endif 00197 # elif defined (_MIPS_) 00198 # if defined (MIPS16) 00199 # define _STLP_NATIVE_INCLUDE_PATH ../mips16 00200 # elif defined (MIPSII) 00201 # define _STLP_NATIVE_INCLUDE_PATH ../mipsII 00202 # elif defined (MIPSII_FP) 00203 # define _STLP_NATIVE_INCLUDE_PATH ../mipsII_fp 00204 # elif defined (MIPSIV) 00205 # define _STLP_NATIVE_INCLUDE_PATH ../mipsIV 00206 # elif defined (MIPSIV_FP) 00207 # define _STLP_NATIVE_INCLUDE_PATH ../mipsIV_fp 00208 # else 00209 # error Unknown MIPS SDK. 00210 # endif 00211 # elif defined (SHx) 00212 # if defined (SH3) 00213 # define _STLP_NATIVE_INCLUDE_PATH ../sh3 00214 # elif defined (SH4) 00215 # define _STLP_NATIVE_INCLUDE_PATH ../sh4 00216 # else 00217 # error Unknown SHx SDK. 00218 # endif 00219 # else 00220 # error Unknown SDK. 00221 # endif 00222 # endif /* !_STLP_NATIVE_INCLUDE_PATH */ 00223 00224 /* Workaround when using MFCCE and using <new> together: MFCCE's wcealt.h doesn't 00225 * check for __PLACEMENT_NEW_INLINE before defining operator new, so when <new> 00226 * defines the operatore before, there will be an error C2084: 00227 * "function 'void *__cdecl operator new(unsigned int,void *)' already has a body". 00228 */ 00229 # ifdef _STLP_USE_MFC 00230 # define __PLACEMENT_NEW_INLINE 00231 # endif 00232 00233 #endif /* _STLP_WCE_NET */ 00234 00235 /* Workaround in _windows.h needs native headers access macros 00236 * to be defined */ 00237 #include <stl/config/_native_headers.h> 00238 00239 /* 00240 * eMbedded Visual C++ 3.0 specific settings 00241 */ 00242 #if defined (_STLP_WCE_EVC3) 00243 00244 # define _STLP_NO_NATIVE_MBSTATE_T 00245 00246 // evc3 has no locale and time support 00247 # define _STLP_NO_LOCALE_SUPPORT 00248 # define _STLP_NO_TIME_SUPPORT 00249 00250 // evc3 has new, but no explicit header 00251 # define _STLP_NO_NEW_HEADER 00252 # define _STLP_NO_NEW_NEW_HEADER 00253 00254 // evc3 has no bad_alloc and no typeinfo 00255 # undef _STLP_NO_BAD_ALLOC 00256 # define _STLP_NO_BAD_ALLOC 00257 00258 # undef _STLP_NO_TYPEINFO 00259 # define _STLP_NO_TYPEINFO 00260 00261 // missing things in eMbedded Visual C++ 3.0 headers 00262 # ifndef _SIZE_T_DEFINED 00263 typedef unsigned int size_t; 00264 # define _SIZE_T_DEFINED 00265 # endif 00266 00267 # ifndef _WCHAR_T_DEFINED 00268 typedef unsigned short wchar_t; 00269 # define _WCHAR_T_DEFINED 00270 # endif 00271 00272 // ptrdiff_t is not defined in evc3 headers 00273 # ifndef _PTRDIFF_T_DEFINED 00274 typedef int ptrdiff_t; 00275 # define _PTRDIFF_T_DEFINED 00276 # endif 00277 00278 // clock_t is not defined in evc3 headers 00279 # ifndef _CLOCK_T_DEFINED 00280 typedef long clock_t; 00281 # define _CLOCK_T_DEFINED 00282 # endif 00283 00284 // Struct tm is not defined in evc3 headers 00285 # ifndef _TM_DEFINED 00286 struct tm { 00287 int tm_sec; /* seconds after the minute - [0,59] */ 00288 int tm_min; /* minutes after the hour - [0,59] */ 00289 int tm_hour; /* hours since midnight - [0,23] */ 00290 int tm_mday; /* day of the month - [1,31] */ 00291 int tm_mon; /* months since January - [0,11] */ 00292 int tm_year; /* years since 1900 */ 00293 int tm_wday; /* days since Sunday - [0,6] */ 00294 int tm_yday; /* days since January 1 - [0,365] */ 00295 int tm_isdst; /* daylight savings time flag */ 00296 }; 00297 # define _TM_DEFINED 00298 # endif 00299 00300 // define placement new and delete operator 00301 // note: when MFCCE headers are included first, don't define the new operator, 00302 // since it was already defined in wcealt.h 00303 # ifdef __cplusplus 00304 # ifndef __PLACEMENT_NEW_INLINE 00305 # ifndef _MFC_VER 00306 inline void *__cdecl operator new(size_t, void *_P) { return (_P); } 00307 # endif /* _MFC_VER */ 00308 inline void __cdecl operator delete(void *, void *) { return; } 00309 # define __PLACEMENT_NEW_INLINE 00310 # endif 00311 # endif /* __cplusplus */ 00312 00313 // evc3 doesn't have native wide functions, e.g. fgetwc, wmemmove 00314 # define _STLP_NO_NATIVE_WIDE_FUNCTIONS 00315 00316 // evc3 doesn't have assert.h 00317 # ifndef _ASSERT_DEFINED 00318 # define assert(expr) _STLP_ASSERT(expr) 00319 # define _ASSERT_DEFINED 00320 # endif 00321 00322 #endif /* _STLP_WCE_EVC3 */ 00323 00324 // Minimize windows.h includes 00325 #if !defined (WIN32_LEAN_AND_MEAN) 00326 # define WIN32_LEAN_AND_MEAN 00327 #endif 00328 #if !defined (VC_EXTRALEAN) 00329 # define VC_EXTRALEAN 00330 #endif 00331 #if !defined (STRICT) 00332 # define STRICT 00333 #endif 00334 00335 // Don't let windows.h define its min and max macros. 00336 #if !defined (NOMINMAX) 00337 # define NOMINMAX 00338 #endif 00339 00340 /* 00341 * original call: TerminateProcess(GetCurrentProcess(), 0); 00342 * we substitute the GetCurrentProcess() with the result of the inline function 00343 * defined in kfuncs.h, since we then can avoid including <windows.h> at all. 00344 * all needed Win32 API functions are defined in <stl/_windows.h> 00345 */ 00346 #ifndef _ABORT_DEFINED 00347 # define _STLP_ABORT() TerminateProcess(reinterpret_cast<HANDLE>(66), 0) 00348 # define _ABORT_DEFINED 00349 #endif 00350 00351 // Notice: windows.h isn't included here anymore; all needed defines are in 00352 // stl/_windows.h now 00353 00354 #endif /* _STLP_EVC_H */
Generated on Mon Mar 10 15:32:46 2008 by ![]() |