1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/config/_evc.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,354 @@
1.4 +/*
1.5 + * File to have Microsoft eMbedded Visual C++ 3.0 and .NET working with STLport
1.6 + * May 2004
1.7 + * Origin : Zdenek Nemec - zero@mapfactor.com
1.8 + * Michael Fink - vividos@users.sourceforge.net
1.9 + */
1.10 +
1.11 +#ifndef _STLP_EVC_H
1.12 +#define _STLP_EVC_H
1.13 +
1.14 +#define _STLP_COMPILER "eMbedded Visual C++"
1.15 +
1.16 +// This flag is being used by STLport to support
1.17 +// old-fashioned Windows CE SDK (see stl_wince.h)
1.18 +// do not use with eMebedded Visual C++ 3 or 4!
1.19 +#ifdef _STLP_WINCE
1.20 +# undef _STLP_WINCE
1.21 +#endif
1.22 +
1.23 +/* Compiler dependent define. The following defines may be available:
1.24 + * _STLP_WCE_EVC3 when compiling under eMbedded Visual C++ 3
1.25 + * _STLP_WCE_NET when compiling under eMbedded Visual C++ .NET
1.26 + * _STLP_WCE always defined when compiling with one of the above
1.27 + */
1.28 +#undef _STLP_WCE_EVC3
1.29 +#undef _STLP_WCE_NET
1.30 +
1.31 +#if (_WIN32_WCE > 300)
1.32 +# define _STLP_WCE_NET UNDER_CE
1.33 +#elif (_WIN32_WCE == 300)
1.34 +# define _STLP_WCE_EVC3 UNDER_CE
1.35 +#else
1.36 +# error No support for Windows CE below 3.0!
1.37 +#endif
1.38 +
1.39 +// This is defined for all platforms using Windows CE
1.40 +#define _STLP_WCE
1.41 +
1.42 +/* All Windows CE versions up to at least version 5 are little-endian, even
1.43 + * if the hardware (like e.g. MIPS) can be configured for big-endian, too. */
1.44 +#define _STLP_LITTLE_ENDIAN
1.45 +
1.46 +// Ensure _DEBUG is defined.
1.47 +#if defined (DEBUG) && !defined (_DEBUG)
1.48 +# define _DEBUG
1.49 +#endif
1.50 +
1.51 +// in evc3/4, on ARM, check that _STLP_DEBUG is not defined
1.52 +// the ARM compiler has a bug that prevents that debug mode from working
1.53 +#if _WIN32_WCE < 500 && defined(ARM) && defined(_STLP_DEBUG)
1.54 +# error _STLP_DEBUG mode is not supported in evc3 and evc4 on the ARM platform!
1.55 +#endif
1.56 +
1.57 +// inherit all msvc6 options
1.58 +#include <stl/config/_msvc.h>
1.59 +
1.60 +// CE up to at least version 5 has no C locale support
1.61 +#define _STLP_NO_LOCALE_SUPPORT
1.62 +
1.63 +#if _WIN32_WCE >= 0x500
1.64 + // SDKs built with PB5 have terminate&co in namespace std...
1.65 +# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_STD
1.66 +# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_STD
1.67 + // ...and new_handler/set_new_handler in the global namespace.
1.68 +# define _STLP_GLOBAL_NEW_HANDLER 1
1.69 +#endif
1.70 +
1.71 +// Always threaded in eMbedded Visual C++ 3.0 and .NET
1.72 +#ifndef _MT
1.73 +# define _MT
1.74 +#endif
1.75 +
1.76 +// we don't have a static native runtime library
1.77 +#undef _STLP_USING_CROSS_NATIVE_RUNTIME_LIB
1.78 +
1.79 +#if _WIN32_WCE < 400
1.80 +// no long double under CE3 and older
1.81 +# define _STLP_NO_LONG_DOUBLE
1.82 +#endif
1.83 +
1.84 +// no *f and *l math functions available
1.85 +#define _STLP_NO_VENDOR_MATH_F
1.86 +#define _STLP_NO_VENDOR_MATH_L
1.87 +
1.88 +/*
1.89 + * Redirect cout, cerr and clog:
1.90 + * If defined redirect cout, cerr and clog to
1.91 + * files stdout.txt, stderr.txt and stdlog.txt
1.92 + */
1.93 +//# define _STLP_REDIRECT_STDSTREAMS
1.94 +
1.95 +/*
1.96 + * Static class members may generate LNK1179:
1.97 + * Wrong COMDAT packing may cause LNK1179 error.
1.98 + * For details see http://groups.google.com/groups?th=8a05c82c4ffee280
1.99 + * example P78. This define is not used/needed at this moment
1.100 + * but may came handy in future...
1.101 + */
1.102 +//# define _STLP_STATIC_MEMBERS_BUG
1.103 +
1.104 +// Use wide-string interface of windows native functions (CreateFile...).
1.105 +// Note that this should be defined all the time while under CE.
1.106 +#if defined (UNICODE)
1.107 +# define _STLP_USE_WIDE_INTERFACE
1.108 +#endif
1.109 +
1.110 +// Force exception std to std instead of __std_alias.
1.111 +#if defined (__cplusplus) && !defined (_STLP_HAS_NO_NAMESPACES)
1.112 +# ifdef _STLP_VENDOR_EXCEPT_STD
1.113 +# undef _STLP_VENDOR_EXCEPT_STD
1.114 +# endif
1.115 +# define _STLP_VENDOR_EXCEPT_STD std
1.116 +#endif
1.117 +
1.118 +// short string optimization bug under evc3, evc4 using ARM compiler
1.119 +#if _MSC_VER<1400 && (defined (ARM) || defined (_ARM_))
1.120 +# define _STLP_DONT_USE_SHORT_STRING_OPTIM
1.121 +#endif
1.122 +
1.123 +// when using MFC, disable another placement new declaration, since there is one in wcealt.h
1.124 +#if !defined (__BUILDING_STLPORT) && defined (_MFC_VER)
1.125 +# define __PLACEMENT_NEW_INLINE
1.126 +#endif
1.127 +
1.128 +// threads
1.129 +#undef _REENTRANT
1.130 +#define _REENTRANT
1.131 +#undef _NOTHREADS
1.132 +
1.133 +// Use old fashioned headers (ctime vs. time.h).
1.134 +#undef _STLP_NO_NEW_C_HEADERS
1.135 +#define _STLP_NO_NEW_C_HEADERS
1.136 +
1.137 +// exception handling support: only on evc4 and user added /GX to project settings
1.138 +#if defined (_STLP_WCE_EVC3) || !defined (_CPPUNWIND)
1.139 +# define _STLP_NO_EXCEPTION_HEADER
1.140 +# define _STLP_NO_EXCEPTIONS
1.141 +# undef _STLP_USE_EXCEPTIONS
1.142 +# ifndef __THROW_BAD_ALLOC
1.143 +# define __THROW_BAD_ALLOC { _STLP_WINCE_TRACE(L"out of memory"); ExitThread(1); }
1.144 +# endif
1.145 +#endif
1.146 +
1.147 +#define _STLP_WINCE_TRACE(msg) OutputDebugString(msg)
1.148 +
1.149 +/*
1.150 + * eMbedded Visual C++ .NET specific settings
1.151 + */
1.152 +#if defined (_STLP_WCE_NET)
1.153 +
1.154 +// evc4 has no locale and time support
1.155 +# define _STLP_NO_LOCALE_SUPPORT
1.156 +# define _STLP_NO_TIME_SUPPORT
1.157 +
1.158 +// ptrdiff_t is not defined in evc4 headers
1.159 +# ifndef _PTRDIFF_T_DEFINED
1.160 + typedef int ptrdiff_t;
1.161 +# define _PTRDIFF_T_DEFINED
1.162 +# endif
1.163 +
1.164 +/*
1.165 + * Helper macros for including the native headers in cases where a file with
1.166 + * the same name also exists in the STLport include folder. The idea behind
1.167 + * this is that we first go up one directory and then down into a dir that
1.168 + * is only present in the native install but not in STLport.
1.169 + *
1.170 + */
1.171 +# if !defined (_STLP_NATIVE_INCLUDE_PATH)
1.172 +# if defined (_X86_)
1.173 +# if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR)
1.174 +# define _STLP_NATIVE_INCLUDE_PATH ../Emulator
1.175 +# else
1.176 +# define _STLP_NATIVE_INCLUDE_PATH ../X86
1.177 +# endif
1.178 +# elif defined (_ARM_)
1.179 +# if _MSC_VER < 1400
1.180 + // eVC3/4
1.181 +# if defined (ARMV4)
1.182 +# define _STLP_NATIVE_INCLUDE_PATH ../Armv4
1.183 +# elif defined (ARMV4I)
1.184 +# define _STLP_NATIVE_INCLUDE_PATH ../Armv4i
1.185 +# elif defined (ARMV4T)
1.186 +# define _STLP_NATIVE_INCLUDE_PATH ../Armv4t
1.187 +# else
1.188 +# error Unknown ARM SDK.
1.189 +# endif
1.190 +# else
1.191 + // VC8 crosscompiling for CE
1.192 +# if defined (ARMV4)
1.193 +# define _STLP_NATIVE_INCLUDE_PATH ../Armv4
1.194 +# elif defined(ARMV4I) || defined(ARMV4T)
1.195 +# define _STLP_NATIVE_INCLUDE_PATH ../Armv4i
1.196 +# else
1.197 +# error Unknown ARM SDK.
1.198 +# endif
1.199 +# endif
1.200 +# elif defined (_MIPS_)
1.201 +# if defined (MIPS16)
1.202 +# define _STLP_NATIVE_INCLUDE_PATH ../mips16
1.203 +# elif defined (MIPSII)
1.204 +# define _STLP_NATIVE_INCLUDE_PATH ../mipsII
1.205 +# elif defined (MIPSII_FP)
1.206 +# define _STLP_NATIVE_INCLUDE_PATH ../mipsII_fp
1.207 +# elif defined (MIPSIV)
1.208 +# define _STLP_NATIVE_INCLUDE_PATH ../mipsIV
1.209 +# elif defined (MIPSIV_FP)
1.210 +# define _STLP_NATIVE_INCLUDE_PATH ../mipsIV_fp
1.211 +# else
1.212 +# error Unknown MIPS SDK.
1.213 +# endif
1.214 +# elif defined (SHx)
1.215 +# if defined (SH3)
1.216 +# define _STLP_NATIVE_INCLUDE_PATH ../sh3
1.217 +# elif defined (SH4)
1.218 +# define _STLP_NATIVE_INCLUDE_PATH ../sh4
1.219 +# else
1.220 +# error Unknown SHx SDK.
1.221 +# endif
1.222 +# else
1.223 +# error Unknown SDK.
1.224 +# endif
1.225 +# endif /* !_STLP_NATIVE_INCLUDE_PATH */
1.226 +
1.227 +/* Workaround when using MFCCE and using <new> together: MFCCE's wcealt.h doesn't
1.228 + * check for __PLACEMENT_NEW_INLINE before defining operator new, so when <new>
1.229 + * defines the operatore before, there will be an error C2084:
1.230 + * "function 'void *__cdecl operator new(unsigned int,void *)' already has a body".
1.231 + */
1.232 +# ifdef _STLP_USE_MFC
1.233 +# define __PLACEMENT_NEW_INLINE
1.234 +# endif
1.235 +
1.236 +#endif /* _STLP_WCE_NET */
1.237 +
1.238 +/* Workaround in _windows.h needs native headers access macros
1.239 + * to be defined */
1.240 +#include <stl/config/_native_headers.h>
1.241 +
1.242 +/*
1.243 + * eMbedded Visual C++ 3.0 specific settings
1.244 + */
1.245 +#if defined (_STLP_WCE_EVC3)
1.246 +
1.247 +# define _STLP_NO_NATIVE_MBSTATE_T
1.248 +
1.249 +// evc3 has no locale and time support
1.250 +# define _STLP_NO_LOCALE_SUPPORT
1.251 +# define _STLP_NO_TIME_SUPPORT
1.252 +
1.253 +// evc3 has new, but no explicit header
1.254 +# define _STLP_NO_NEW_HEADER
1.255 +# define _STLP_NO_NEW_NEW_HEADER
1.256 +
1.257 +// evc3 has no bad_alloc and no typeinfo
1.258 +# undef _STLP_NO_BAD_ALLOC
1.259 +# define _STLP_NO_BAD_ALLOC
1.260 +
1.261 +# undef _STLP_NO_TYPEINFO
1.262 +# define _STLP_NO_TYPEINFO
1.263 +
1.264 +// missing things in eMbedded Visual C++ 3.0 headers
1.265 +# ifndef _SIZE_T_DEFINED
1.266 + typedef unsigned int size_t;
1.267 +# define _SIZE_T_DEFINED
1.268 +# endif
1.269 +
1.270 +# ifndef _WCHAR_T_DEFINED
1.271 + typedef unsigned short wchar_t;
1.272 +# define _WCHAR_T_DEFINED
1.273 +# endif
1.274 +
1.275 +// ptrdiff_t is not defined in evc3 headers
1.276 +# ifndef _PTRDIFF_T_DEFINED
1.277 + typedef int ptrdiff_t;
1.278 +# define _PTRDIFF_T_DEFINED
1.279 +# endif
1.280 +
1.281 +// clock_t is not defined in evc3 headers
1.282 +# ifndef _CLOCK_T_DEFINED
1.283 + typedef long clock_t;
1.284 +# define _CLOCK_T_DEFINED
1.285 +# endif
1.286 +
1.287 +// Struct tm is not defined in evc3 headers
1.288 +# ifndef _TM_DEFINED
1.289 +struct tm {
1.290 + int tm_sec; /* seconds after the minute - [0,59] */
1.291 + int tm_min; /* minutes after the hour - [0,59] */
1.292 + int tm_hour; /* hours since midnight - [0,23] */
1.293 + int tm_mday; /* day of the month - [1,31] */
1.294 + int tm_mon; /* months since January - [0,11] */
1.295 + int tm_year; /* years since 1900 */
1.296 + int tm_wday; /* days since Sunday - [0,6] */
1.297 + int tm_yday; /* days since January 1 - [0,365] */
1.298 + int tm_isdst; /* daylight savings time flag */
1.299 +};
1.300 +# define _TM_DEFINED
1.301 +# endif
1.302 +
1.303 +// define placement new and delete operator
1.304 +// note: when MFCCE headers are included first, don't define the new operator,
1.305 +// since it was already defined in wcealt.h
1.306 +# ifdef __cplusplus
1.307 +# ifndef __PLACEMENT_NEW_INLINE
1.308 +# ifndef _MFC_VER
1.309 +inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
1.310 +# endif /* _MFC_VER */
1.311 +inline void __cdecl operator delete(void *, void *) { return; }
1.312 +# define __PLACEMENT_NEW_INLINE
1.313 +# endif
1.314 +# endif /* __cplusplus */
1.315 +
1.316 +// evc3 doesn't have native wide functions, e.g. fgetwc, wmemmove
1.317 +# define _STLP_NO_NATIVE_WIDE_FUNCTIONS
1.318 +
1.319 +// evc3 doesn't have assert.h
1.320 +# ifndef _ASSERT_DEFINED
1.321 +# define assert(expr) _STLP_ASSERT(expr)
1.322 +# define _ASSERT_DEFINED
1.323 +# endif
1.324 +
1.325 +#endif /* _STLP_WCE_EVC3 */
1.326 +
1.327 +// Minimize windows.h includes
1.328 +#if !defined (WIN32_LEAN_AND_MEAN)
1.329 +# define WIN32_LEAN_AND_MEAN
1.330 +#endif
1.331 +#if !defined (VC_EXTRALEAN)
1.332 +# define VC_EXTRALEAN
1.333 +#endif
1.334 +#if !defined (STRICT)
1.335 +# define STRICT
1.336 +#endif
1.337 +
1.338 +// Don't let windows.h define its min and max macros.
1.339 +#if !defined (NOMINMAX)
1.340 +# define NOMINMAX
1.341 +#endif
1.342 +
1.343 +/*
1.344 + * original call: TerminateProcess(GetCurrentProcess(), 0);
1.345 + * we substitute the GetCurrentProcess() with the result of the inline function
1.346 + * defined in kfuncs.h, since we then can avoid including <windows.h> at all.
1.347 + * all needed Win32 API functions are defined in <stl/_windows.h>
1.348 + */
1.349 +#ifndef _ABORT_DEFINED
1.350 +# define _STLP_ABORT() TerminateProcess(reinterpret_cast<HANDLE>(66), 0)
1.351 +# define _ABORT_DEFINED
1.352 +#endif
1.353 +
1.354 +// Notice: windows.h isn't included here anymore; all needed defines are in
1.355 +// stl/_windows.h now
1.356 +
1.357 +#endif /* _STLP_EVC_H */