Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygen_evc.h
Go 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 // inherit all msvc6 options 00049 #include <stl/config/_msvc.h> 00050 00051 // CE up to at least version 5 has no C locale support 00052 #define _STLP_NO_LOCALE_SUPPORT 00053 00054 #if _WIN32_WCE >= 420 00055 // SDKs built with PB5 have terminate&co in namespace std... 00056 # define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_STD 00057 # define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_STD 00058 // ...and new_handler/set_new_handler in the global namespace. 00059 # define _STLP_GLOBAL_NEW_HANDLER 1 00060 #endif 00061 00062 // Always threaded in eMbedded Visual C++ 3.0 and .NET 00063 #ifndef _MT 00064 # define _MT 00065 #endif 00066 00067 // we don't have a static native runtime library 00068 #undef _STLP_USING_CROSS_NATIVE_RUNTIME_LIB 00069 00070 #if _WIN32_WCE < 400 00071 // no long double under CE3 and older 00072 # define _STLP_NO_LONG_DOUBLE 00073 #endif 00074 00075 // no *f and *l math functions available 00076 #define _STLP_NO_VENDOR_MATH_F 00077 #define _STLP_NO_VENDOR_MATH_L 00078 00079 /* 00080 * Redirect cout, cerr and clog: 00081 * If defined redirect cout, cerr and clog to 00082 * files stdout.txt, stderr.txt and stdlog.txt 00083 */ 00084 //# define _STLP_REDIRECT_STDSTREAMS 00085 00086 /* 00087 * Static class members may generate LNK1179: 00088 * Wrong COMDAT packing may cause LNK1179 error. 00089 * For details see http://groups.google.com/groups?th=8a05c82c4ffee280 00090 * example P78. This define is not used/needed at this moment 00091 * but may came handy in future... 00092 */ 00093 //# define _STLP_STATIC_MEMBERS_BUG 00094 00095 // Use wide-string interface of windows native functions (CreateFile...). 00096 // Note that this should be defined all the time while under CE. 00097 #if defined (UNICODE) 00098 # define _STLP_USE_WIDE_INTERFACE 00099 #endif 00100 00101 // Force exception std to std instead of __std_alias. 00102 #if defined (__cplusplus) && !defined (_STLP_HAS_NO_NAMESPACES) 00103 # ifdef _STLP_VENDOR_EXCEPT_STD 00104 # undef _STLP_VENDOR_EXCEPT_STD 00105 # endif 00106 # define _STLP_VENDOR_EXCEPT_STD std 00107 #endif 00108 00109 // short string optimization bug under evc3, evc4 using ARM compiler 00110 #if _MSC_VER < 1400 && (defined (ARM) || defined (_ARM_)) 00111 # define _STLP_DONT_USE_SHORT_STRING_OPTIM 00112 #endif 00113 00114 // when using MFC, disable another placement new declaration, since there is one in wcealt.h 00115 #if !defined (__BUILDING_STLPORT) && defined (_MFC_VER) 00116 # define __PLACEMENT_NEW_INLINE 00117 #endif 00118 00119 // threads 00120 #undef _REENTRANT 00121 #define _REENTRANT 00122 #undef _NOTHREADS 00123 00124 // Use old fashioned headers (ctime vs. time.h). 00125 #undef _STLP_NO_NEW_C_HEADERS 00126 #define _STLP_NO_NEW_C_HEADERS 00127 00128 // exception handling support: only on evc4 and user added /GX to project settings 00129 #if defined (_STLP_WCE_EVC3) || !defined (_CPPUNWIND) 00130 # define _STLP_NO_EXCEPTION_HEADER 00131 # define _STLP_NO_EXCEPTIONS 00132 # undef _STLP_USE_EXCEPTIONS 00133 # ifndef _STLP_THROW_BAD_ALLOC 00134 # define _STLP_THROW_BAD_ALLOC { _STLP_WINCE_TRACE(L"out of memory"); ExitThread(1); } 00135 # endif 00136 #endif 00137 00138 #define _STLP_WINCE_TRACE(msg) OutputDebugString(msg) 00139 00140 /* 00141 * eMbedded Visual C++ .NET specific settings 00142 */ 00143 #if defined (_STLP_WCE_NET) 00144 00145 // evc4 has no locale and time support 00146 # define _STLP_NO_LOCALE_SUPPORT 00147 # define _STLP_NO_TIME_SUPPORT 00148 00149 // ptrdiff_t is not defined in evc4 headers 00150 # ifndef _PTRDIFF_T_DEFINED 00151 typedef int ptrdiff_t; 00152 # define _PTRDIFF_T_DEFINED 00153 # endif 00154 00155 /* 00156 * Helper macros for including the native headers in cases where a file with 00157 * the same name also exists in the STLport include folder. The idea behind 00158 * this is that we first go up one directory and then down into a dir that 00159 * is only present in the native install but not in STLport. 00160 * 00161 */ 00162 # if !defined (_STLP_NATIVE_INCLUDE_PATH) 00163 # if defined (_X86_) 00164 # if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR) 00165 # define _STLP_NATIVE_INCLUDE_PATH ../Emulator 00166 # else 00167 # define _STLP_NATIVE_INCLUDE_PATH ../X86 00168 # endif 00169 # elif defined (_ARM_) 00170 # if _MSC_VER < 1400 00171 // eVC3/4 00172 # if defined (ARMV4) 00173 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4 00174 # elif defined (ARMV4I) 00175 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4i 00176 # elif defined (ARMV4T) 00177 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4t 00178 # else 00179 # error Unknown ARM SDK. 00180 # endif 00181 # else 00182 // VC8 crosscompiling for CE 00183 # if defined (ARMV4) 00184 // VC8 bundled Pocket PC 2003 SDK don't have a target CPU subfolder. 00185 # if defined(WIN32_PLATFORM_PSPC) 00186 # define _STLP_NATIVE_INCLUDE_PATH ../Include 00187 # else 00188 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4 00189 # endif 00190 # elif defined(ARMV4I) || defined(ARMV4T) 00191 # define _STLP_NATIVE_INCLUDE_PATH ../Armv4i 00192 # else 00193 # error Unknown ARM SDK. 00194 # endif 00195 # endif 00196 # elif defined (_MIPS_) 00197 # if defined (MIPS16) 00198 # define _STLP_NATIVE_INCLUDE_PATH ../mips16 00199 # elif defined (MIPSII) 00200 # define _STLP_NATIVE_INCLUDE_PATH ../mipsII 00201 # elif defined (MIPSII_FP) 00202 # define _STLP_NATIVE_INCLUDE_PATH ../mipsII_fp 00203 # elif defined (MIPSIV) 00204 # define _STLP_NATIVE_INCLUDE_PATH ../mipsIV 00205 # elif defined (MIPSIV_FP) 00206 # define _STLP_NATIVE_INCLUDE_PATH ../mipsIV_fp 00207 # else 00208 # error Unknown MIPS SDK. 00209 # endif 00210 # elif defined (SHx) 00211 # if defined (SH3) 00212 # define _STLP_NATIVE_INCLUDE_PATH ../sh3 00213 # elif defined (SH4) 00214 # define _STLP_NATIVE_INCLUDE_PATH ../sh4 00215 # else 00216 # error Unknown SHx SDK. 00217 # endif 00218 # else 00219 # error Unknown SDK. 00220 # endif 00221 # endif /* !_STLP_NATIVE_INCLUDE_PATH */ 00222 00223 /* Workaround when using MFCCE and using <new> together: MFCCE's wcealt.h doesn't 00224 * check for __PLACEMENT_NEW_INLINE before defining operator new, so when <new> 00225 * defines the operatore before, there will be an error C2084: 00226 * "function 'void *__cdecl operator new(unsigned int,void *)' already has a body". 00227 */ 00228 # ifdef _STLP_USE_MFC 00229 # define __PLACEMENT_NEW_INLINE 00230 # endif 00231 00232 #endif /* _STLP_WCE_NET */ 00233 00234 /* 00235 * eMbedded Visual C++ 3.0 specific settings 00236 */ 00237 #if defined (_STLP_WCE_EVC3) 00238 00239 # define _STLP_NO_NATIVE_MBSTATE_T 00240 00241 // evc3 has no locale and time support 00242 # define _STLP_NO_LOCALE_SUPPORT 00243 # define _STLP_NO_TIME_SUPPORT 00244 00245 // evc3 has new, but no explicit header 00246 # define _STLP_NO_NEW_HEADER 00247 # define _STLP_NO_NEW_NEW_HEADER 00248 00249 // evc3 has no bad_alloc and no typeinfo 00250 # undef _STLP_NO_BAD_ALLOC 00251 # define _STLP_NO_BAD_ALLOC 00252 00253 # undef _STLP_NO_TYPEINFO 00254 # define _STLP_NO_TYPEINFO 00255 00256 // missing things in eMbedded Visual C++ 3.0 headers 00257 # ifndef _SIZE_T_DEFINED 00258 typedef unsigned int size_t; 00259 # define _SIZE_T_DEFINED 00260 # endif 00261 00262 # ifndef _WCHAR_T_DEFINED 00263 typedef unsigned short wchar_t; 00264 # define _WCHAR_T_DEFINED 00265 # endif 00266 00267 // ptrdiff_t is not defined in evc3 headers 00268 # ifndef _PTRDIFF_T_DEFINED 00269 typedef int ptrdiff_t; 00270 # define _PTRDIFF_T_DEFINED 00271 # endif 00272 00273 // clock_t is not defined in evc3 headers 00274 # ifndef _CLOCK_T_DEFINED 00275 typedef long clock_t; 00276 # define _CLOCK_T_DEFINED 00277 # endif 00278 00279 // Struct tm is not defined in evc3 headers 00280 # ifndef _TM_DEFINED 00281 struct tm { 00282 int tm_sec; /* seconds after the minute - [0,59] */ 00283 int tm_min; /* minutes after the hour - [0,59] */ 00284 int tm_hour; /* hours since midnight - [0,23] */ 00285 int tm_mday; /* day of the month - [1,31] */ 00286 int tm_mon; /* months since January - [0,11] */ 00287 int tm_year; /* years since 1900 */ 00288 int tm_wday; /* days since Sunday - [0,6] */ 00289 int tm_yday; /* days since January 1 - [0,365] */ 00290 int tm_isdst; /* daylight savings time flag */ 00291 }; 00292 # define _TM_DEFINED 00293 # endif 00294 00295 // define placement new and delete operator 00296 // note: when MFCCE headers are included first, don't define the new operator, 00297 // since it was already defined in wcealt.h 00298 # ifdef __cplusplus 00299 # ifndef __PLACEMENT_NEW_INLINE 00300 # ifndef _MFC_VER 00301 inline void *__cdecl operator new(size_t, void *_P) { return (_P); } 00302 # endif /* _MFC_VER */ 00303 inline void __cdecl operator delete(void *, void *) { return; } 00304 # define __PLACEMENT_NEW_INLINE 00305 # endif 00306 # endif /* __cplusplus */ 00307 00308 // evc3 doesn't have native wide functions, e.g. fgetwc, wmemmove 00309 # define _STLP_NO_NATIVE_WIDE_FUNCTIONS 00310 00311 // evc3 doesn't have assert.h 00312 # ifndef _ASSERT_DEFINED 00313 # define assert(expr) _STLP_ASSERT(expr) 00314 # define _ASSERT_DEFINED 00315 # endif 00316 00317 #endif /* _STLP_WCE_EVC3 */ 00318 00319 /* 00320 * original call: TerminateProcess(GetCurrentProcess(), 0); 00321 * we substitute the GetCurrentProcess() with the result of the inline function 00322 * defined in kfuncs.h, since we then can avoid including <windows.h> at all. 00323 * all needed Win32 API functions are defined in <stl/_windows.h> 00324 */ 00325 #ifndef _ABORT_DEFINED 00326 # define _STLP_ABORT() TerminateProcess(reinterpret_cast<HANDLE>(66), 0) 00327 # define _ABORT_DEFINED 00328 #endif 00329 00330 // Notice: windows.h isn't included here anymore; all needed defines are in 00331 // stl/_windows.h now 00332 00333 #endif /* _STLP_EVC_H */ Generated on Sun May 27 2012 04:29:47 for ReactOS by
1.7.6.1
|