epoc32/include/tools/stlport/stl/config/_evc.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
 * File to have Microsoft eMbedded Visual C++ 3.0 and .NET working with STLport
williamr@4
     3
 * May 2004
williamr@4
     4
 * Origin : Zdenek Nemec - zero@mapfactor.com
williamr@4
     5
 *          Michael Fink - vividos@users.sourceforge.net
williamr@4
     6
 */
williamr@4
     7
williamr@4
     8
#ifndef _STLP_EVC_H
williamr@4
     9
#define _STLP_EVC_H
williamr@4
    10
williamr@4
    11
#define _STLP_COMPILER "eMbedded Visual C++"
williamr@4
    12
williamr@4
    13
// This flag is being used by STLport to support
williamr@4
    14
// old-fashioned Windows CE SDK (see stl_wince.h)
williamr@4
    15
// do not use with eMebedded Visual C++ 3 or 4!
williamr@4
    16
#ifdef _STLP_WINCE
williamr@4
    17
#  undef _STLP_WINCE
williamr@4
    18
#endif
williamr@4
    19
williamr@4
    20
/* Compiler dependent define. The following defines may be available:
williamr@4
    21
 * _STLP_WCE_EVC3 when compiling under eMbedded Visual C++ 3
williamr@4
    22
 * _STLP_WCE_NET  when compiling under eMbedded Visual C++ .NET
williamr@4
    23
 * _STLP_WCE      always defined when compiling with one of the above
williamr@4
    24
 */
williamr@4
    25
#undef _STLP_WCE_EVC3
williamr@4
    26
#undef _STLP_WCE_NET
williamr@4
    27
williamr@4
    28
#if (_WIN32_WCE > 300)
williamr@4
    29
#  define _STLP_WCE_NET UNDER_CE
williamr@4
    30
#elif (_WIN32_WCE == 300)
williamr@4
    31
#  define _STLP_WCE_EVC3 UNDER_CE
williamr@4
    32
#else
williamr@4
    33
#  error No support for Windows CE below 3.0!
williamr@4
    34
#endif
williamr@4
    35
williamr@4
    36
// This is defined for all platforms using Windows CE
williamr@4
    37
#define _STLP_WCE
williamr@4
    38
williamr@4
    39
/* All Windows CE versions up to at least version 5 are little-endian, even
williamr@4
    40
 * if the hardware (like e.g. MIPS) can be configured for big-endian, too. */
williamr@4
    41
#define _STLP_LITTLE_ENDIAN
williamr@4
    42
williamr@4
    43
// Ensure _DEBUG is defined.
williamr@4
    44
#if defined (DEBUG) && !defined (_DEBUG)
williamr@4
    45
#  define _DEBUG
williamr@4
    46
#endif
williamr@4
    47
williamr@4
    48
// in evc3/4, on ARM, check that _STLP_DEBUG is not defined
williamr@4
    49
// the ARM compiler has a bug that prevents that debug mode from working
williamr@4
    50
#if _WIN32_WCE < 500 && defined(ARM) && defined(_STLP_DEBUG)
williamr@4
    51
#  error _STLP_DEBUG mode is not supported in evc3 and evc4 on the ARM platform!
williamr@4
    52
#endif
williamr@4
    53
williamr@4
    54
// inherit all msvc6 options
williamr@4
    55
#include <stl/config/_msvc.h>
williamr@4
    56
williamr@4
    57
// CE up to at least version 5 has no C locale support
williamr@4
    58
#define _STLP_NO_LOCALE_SUPPORT
williamr@4
    59
williamr@4
    60
#if _WIN32_WCE >= 0x500
williamr@4
    61
   // SDKs built with PB5 have terminate&co in namespace std...
williamr@4
    62
#  define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_STD
williamr@4
    63
#  define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_STD
williamr@4
    64
   // ...and new_handler/set_new_handler in the global namespace.
williamr@4
    65
#  define _STLP_GLOBAL_NEW_HANDLER 1
williamr@4
    66
#endif
williamr@4
    67
williamr@4
    68
// Always threaded in eMbedded Visual C++ 3.0 and .NET
williamr@4
    69
#ifndef _MT
williamr@4
    70
#  define _MT
williamr@4
    71
#endif
williamr@4
    72
williamr@4
    73
// we don't have a static native runtime library
williamr@4
    74
#undef _STLP_USING_CROSS_NATIVE_RUNTIME_LIB
williamr@4
    75
williamr@4
    76
#if _WIN32_WCE < 400
williamr@4
    77
// no long double under CE3 and older
williamr@4
    78
#  define _STLP_NO_LONG_DOUBLE
williamr@4
    79
#endif
williamr@4
    80
williamr@4
    81
// no *f and *l math functions available
williamr@4
    82
#define _STLP_NO_VENDOR_MATH_F
williamr@4
    83
#define _STLP_NO_VENDOR_MATH_L
williamr@4
    84
williamr@4
    85
/*
williamr@4
    86
 * Redirect cout, cerr and clog:
williamr@4
    87
 * If defined redirect cout, cerr and clog to
williamr@4
    88
 * files stdout.txt, stderr.txt and stdlog.txt
williamr@4
    89
 */
williamr@4
    90
//# define _STLP_REDIRECT_STDSTREAMS
williamr@4
    91
williamr@4
    92
/*
williamr@4
    93
 * Static class members may generate LNK1179:
williamr@4
    94
 * Wrong COMDAT packing may cause LNK1179 error.
williamr@4
    95
 * For details see http://groups.google.com/groups?th=8a05c82c4ffee280
williamr@4
    96
 * example P78. This define is not used/needed at this moment
williamr@4
    97
 * but may came handy in future...
williamr@4
    98
 */
williamr@4
    99
//# define _STLP_STATIC_MEMBERS_BUG
williamr@4
   100
williamr@4
   101
// Use wide-string interface of windows native functions (CreateFile...).
williamr@4
   102
// Note that this should be defined all the time while under CE.
williamr@4
   103
#if defined (UNICODE)
williamr@4
   104
#  define _STLP_USE_WIDE_INTERFACE
williamr@4
   105
#endif
williamr@4
   106
williamr@4
   107
// Force exception std to std instead of __std_alias.
williamr@4
   108
#if defined (__cplusplus) && !defined (_STLP_HAS_NO_NAMESPACES)
williamr@4
   109
#  ifdef _STLP_VENDOR_EXCEPT_STD
williamr@4
   110
#    undef _STLP_VENDOR_EXCEPT_STD
williamr@4
   111
#  endif
williamr@4
   112
#  define _STLP_VENDOR_EXCEPT_STD std
williamr@4
   113
#endif
williamr@4
   114
williamr@4
   115
// short string optimization bug under evc3, evc4 using ARM compiler
williamr@4
   116
#if _MSC_VER<1400 && (defined (ARM) || defined (_ARM_))
williamr@4
   117
#  define _STLP_DONT_USE_SHORT_STRING_OPTIM
williamr@4
   118
#endif
williamr@4
   119
williamr@4
   120
// when using MFC, disable another placement new declaration, since there is one in wcealt.h
williamr@4
   121
#if !defined (__BUILDING_STLPORT) && defined (_MFC_VER)
williamr@4
   122
#  define __PLACEMENT_NEW_INLINE
williamr@4
   123
#endif
williamr@4
   124
williamr@4
   125
// threads
williamr@4
   126
#undef _REENTRANT
williamr@4
   127
#define _REENTRANT
williamr@4
   128
#undef _NOTHREADS
williamr@4
   129
williamr@4
   130
// Use old fashioned headers (ctime vs. time.h).
williamr@4
   131
#undef _STLP_NO_NEW_C_HEADERS
williamr@4
   132
#define _STLP_NO_NEW_C_HEADERS
williamr@4
   133
williamr@4
   134
// exception handling support: only on evc4 and user added /GX to project settings
williamr@4
   135
#if defined (_STLP_WCE_EVC3) || !defined (_CPPUNWIND)
williamr@4
   136
#  define _STLP_NO_EXCEPTION_HEADER
williamr@4
   137
#  define _STLP_NO_EXCEPTIONS
williamr@4
   138
#  undef _STLP_USE_EXCEPTIONS
williamr@4
   139
#  ifndef __THROW_BAD_ALLOC
williamr@4
   140
#    define __THROW_BAD_ALLOC { _STLP_WINCE_TRACE(L"out of memory"); ExitThread(1); }
williamr@4
   141
#  endif
williamr@4
   142
#endif
williamr@4
   143
williamr@4
   144
#define _STLP_WINCE_TRACE(msg) OutputDebugString(msg)
williamr@4
   145
williamr@4
   146
/*
williamr@4
   147
 * eMbedded Visual C++ .NET specific settings
williamr@4
   148
 */
williamr@4
   149
#if defined (_STLP_WCE_NET)
williamr@4
   150
williamr@4
   151
// evc4 has no locale and time support
williamr@4
   152
#  define _STLP_NO_LOCALE_SUPPORT
williamr@4
   153
#  define _STLP_NO_TIME_SUPPORT
williamr@4
   154
williamr@4
   155
// ptrdiff_t is not defined in evc4 headers
williamr@4
   156
#  ifndef _PTRDIFF_T_DEFINED
williamr@4
   157
   typedef int ptrdiff_t;
williamr@4
   158
#    define _PTRDIFF_T_DEFINED
williamr@4
   159
#  endif
williamr@4
   160
williamr@4
   161
/*
williamr@4
   162
 * Helper macros for including the native headers in cases where a file with
williamr@4
   163
 * the same name also exists in the STLport include folder. The idea behind
williamr@4
   164
 * this is that we first go up one directory and then down into a dir that
williamr@4
   165
 * is only present in the native install but not in STLport.
williamr@4
   166
 *
williamr@4
   167
 */
williamr@4
   168
#  if !defined (_STLP_NATIVE_INCLUDE_PATH)
williamr@4
   169
#    if defined (_X86_)
williamr@4
   170
#      if defined (_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR)
williamr@4
   171
#        define _STLP_NATIVE_INCLUDE_PATH ../Emulator
williamr@4
   172
#      else
williamr@4
   173
#        define _STLP_NATIVE_INCLUDE_PATH ../X86
williamr@4
   174
#      endif
williamr@4
   175
#    elif defined (_ARM_)
williamr@4
   176
#      if _MSC_VER < 1400
williamr@4
   177
         // eVC3/4
williamr@4
   178
#        if defined (ARMV4)
williamr@4
   179
#          define _STLP_NATIVE_INCLUDE_PATH ../Armv4
williamr@4
   180
#        elif defined (ARMV4I)
williamr@4
   181
#          define _STLP_NATIVE_INCLUDE_PATH ../Armv4i
williamr@4
   182
#        elif defined (ARMV4T)
williamr@4
   183
#          define _STLP_NATIVE_INCLUDE_PATH ../Armv4t
williamr@4
   184
#        else
williamr@4
   185
#          error Unknown ARM SDK.
williamr@4
   186
#        endif
williamr@4
   187
#      else
williamr@4
   188
         // VC8 crosscompiling for CE
williamr@4
   189
#        if defined (ARMV4)
williamr@4
   190
#          define _STLP_NATIVE_INCLUDE_PATH ../Armv4
williamr@4
   191
#        elif defined(ARMV4I) || defined(ARMV4T)
williamr@4
   192
#          define _STLP_NATIVE_INCLUDE_PATH ../Armv4i
williamr@4
   193
#        else
williamr@4
   194
#          error Unknown ARM SDK.
williamr@4
   195
#        endif
williamr@4
   196
#      endif
williamr@4
   197
#    elif defined (_MIPS_)
williamr@4
   198
#      if defined (MIPS16)
williamr@4
   199
#        define _STLP_NATIVE_INCLUDE_PATH ../mips16
williamr@4
   200
#      elif defined (MIPSII)
williamr@4
   201
#        define _STLP_NATIVE_INCLUDE_PATH ../mipsII
williamr@4
   202
#      elif defined (MIPSII_FP)
williamr@4
   203
#        define _STLP_NATIVE_INCLUDE_PATH ../mipsII_fp
williamr@4
   204
#      elif defined (MIPSIV)
williamr@4
   205
#        define _STLP_NATIVE_INCLUDE_PATH ../mipsIV
williamr@4
   206
#      elif defined (MIPSIV_FP)
williamr@4
   207
#        define _STLP_NATIVE_INCLUDE_PATH ../mipsIV_fp
williamr@4
   208
#      else
williamr@4
   209
#        error Unknown MIPS SDK.
williamr@4
   210
#      endif
williamr@4
   211
#    elif defined (SHx)
williamr@4
   212
#      if defined (SH3)
williamr@4
   213
#        define _STLP_NATIVE_INCLUDE_PATH ../sh3
williamr@4
   214
#      elif defined (SH4)
williamr@4
   215
#        define _STLP_NATIVE_INCLUDE_PATH ../sh4
williamr@4
   216
#      else
williamr@4
   217
#        error Unknown SHx SDK.
williamr@4
   218
#      endif
williamr@4
   219
#    else
williamr@4
   220
#      error Unknown SDK.
williamr@4
   221
#    endif
williamr@4
   222
#  endif /* !_STLP_NATIVE_INCLUDE_PATH */
williamr@4
   223
williamr@4
   224
/* Workaround when using MFCCE and using <new> together: MFCCE's wcealt.h doesn't
williamr@4
   225
 * check for __PLACEMENT_NEW_INLINE before defining operator new, so when <new>
williamr@4
   226
 * defines the operatore before, there will be an error C2084:
williamr@4
   227
 * "function 'void *__cdecl operator new(unsigned int,void *)' already has a body".
williamr@4
   228
 */
williamr@4
   229
#  ifdef _STLP_USE_MFC
williamr@4
   230
#    define __PLACEMENT_NEW_INLINE
williamr@4
   231
#  endif
williamr@4
   232
williamr@4
   233
#endif /* _STLP_WCE_NET */
williamr@4
   234
williamr@4
   235
/* Workaround in _windows.h needs native headers access macros
williamr@4
   236
 * to be defined */
williamr@4
   237
#include <stl/config/_native_headers.h>
williamr@4
   238
williamr@4
   239
/*
williamr@4
   240
 * eMbedded Visual C++ 3.0 specific settings
williamr@4
   241
 */
williamr@4
   242
#if defined (_STLP_WCE_EVC3)
williamr@4
   243
williamr@4
   244
#  define _STLP_NO_NATIVE_MBSTATE_T
williamr@4
   245
williamr@4
   246
// evc3 has no locale and time support
williamr@4
   247
#  define _STLP_NO_LOCALE_SUPPORT
williamr@4
   248
#  define _STLP_NO_TIME_SUPPORT
williamr@4
   249
williamr@4
   250
// evc3 has new, but no explicit header
williamr@4
   251
#  define _STLP_NO_NEW_HEADER
williamr@4
   252
#  define _STLP_NO_NEW_NEW_HEADER
williamr@4
   253
williamr@4
   254
// evc3 has no bad_alloc and no typeinfo
williamr@4
   255
#  undef _STLP_NO_BAD_ALLOC
williamr@4
   256
#  define _STLP_NO_BAD_ALLOC
williamr@4
   257
williamr@4
   258
#  undef _STLP_NO_TYPEINFO
williamr@4
   259
#  define _STLP_NO_TYPEINFO
williamr@4
   260
williamr@4
   261
// missing things in eMbedded Visual C++ 3.0 headers
williamr@4
   262
#  ifndef _SIZE_T_DEFINED
williamr@4
   263
   typedef unsigned int size_t;
williamr@4
   264
#    define _SIZE_T_DEFINED
williamr@4
   265
#  endif
williamr@4
   266
williamr@4
   267
#  ifndef _WCHAR_T_DEFINED
williamr@4
   268
   typedef unsigned short wchar_t;
williamr@4
   269
#    define _WCHAR_T_DEFINED
williamr@4
   270
#  endif
williamr@4
   271
williamr@4
   272
// ptrdiff_t is not defined in evc3 headers
williamr@4
   273
#  ifndef _PTRDIFF_T_DEFINED
williamr@4
   274
   typedef int ptrdiff_t;
williamr@4
   275
#    define _PTRDIFF_T_DEFINED
williamr@4
   276
#  endif
williamr@4
   277
williamr@4
   278
// clock_t is not defined in evc3 headers
williamr@4
   279
#  ifndef _CLOCK_T_DEFINED
williamr@4
   280
   typedef long clock_t;
williamr@4
   281
#    define _CLOCK_T_DEFINED
williamr@4
   282
#  endif
williamr@4
   283
williamr@4
   284
// Struct tm is not defined in evc3 headers
williamr@4
   285
#  ifndef _TM_DEFINED
williamr@4
   286
struct tm {
williamr@4
   287
   int tm_sec;     /* seconds after the minute - [0,59] */
williamr@4
   288
   int tm_min;     /* minutes after the hour - [0,59] */
williamr@4
   289
   int tm_hour;    /* hours since midnight - [0,23] */
williamr@4
   290
   int tm_mday;    /* day of the month - [1,31] */
williamr@4
   291
   int tm_mon;     /* months since January - [0,11] */
williamr@4
   292
   int tm_year;    /* years since 1900 */
williamr@4
   293
   int tm_wday;    /* days since Sunday - [0,6] */
williamr@4
   294
   int tm_yday;    /* days since January 1 - [0,365] */
williamr@4
   295
   int tm_isdst;   /* daylight savings time flag */
williamr@4
   296
};
williamr@4
   297
#    define _TM_DEFINED
williamr@4
   298
#  endif
williamr@4
   299
williamr@4
   300
// define placement new and delete operator
williamr@4
   301
// note: when MFCCE headers are included first, don't define the new operator,
williamr@4
   302
//       since it was already defined in wcealt.h
williamr@4
   303
#  ifdef __cplusplus
williamr@4
   304
#    ifndef __PLACEMENT_NEW_INLINE
williamr@4
   305
#      ifndef _MFC_VER
williamr@4
   306
inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
williamr@4
   307
#      endif /* _MFC_VER */
williamr@4
   308
inline void __cdecl operator delete(void *, void *) { return; }
williamr@4
   309
#      define __PLACEMENT_NEW_INLINE
williamr@4
   310
#    endif
williamr@4
   311
#  endif /* __cplusplus */
williamr@4
   312
williamr@4
   313
// evc3 doesn't have native wide functions, e.g. fgetwc, wmemmove
williamr@4
   314
#  define _STLP_NO_NATIVE_WIDE_FUNCTIONS
williamr@4
   315
williamr@4
   316
// evc3 doesn't have assert.h
williamr@4
   317
#  ifndef _ASSERT_DEFINED
williamr@4
   318
#    define assert(expr) _STLP_ASSERT(expr)
williamr@4
   319
#    define _ASSERT_DEFINED
williamr@4
   320
#  endif
williamr@4
   321
williamr@4
   322
#endif /* _STLP_WCE_EVC3 */
williamr@4
   323
williamr@4
   324
// Minimize windows.h includes
williamr@4
   325
#if !defined (WIN32_LEAN_AND_MEAN)
williamr@4
   326
#  define WIN32_LEAN_AND_MEAN
williamr@4
   327
#endif
williamr@4
   328
#if !defined (VC_EXTRALEAN)
williamr@4
   329
#  define VC_EXTRALEAN
williamr@4
   330
#endif
williamr@4
   331
#if !defined (STRICT)
williamr@4
   332
#  define STRICT
williamr@4
   333
#endif
williamr@4
   334
williamr@4
   335
// Don't let windows.h define its min and max macros.
williamr@4
   336
#if !defined (NOMINMAX)
williamr@4
   337
#  define NOMINMAX
williamr@4
   338
#endif
williamr@4
   339
williamr@4
   340
/*
williamr@4
   341
 * original call: TerminateProcess(GetCurrentProcess(), 0);
williamr@4
   342
 * we substitute the GetCurrentProcess() with the result of the inline function
williamr@4
   343
 * defined in kfuncs.h, since we then can avoid including <windows.h> at all.
williamr@4
   344
 * all needed Win32 API functions are defined in <stl/_windows.h>
williamr@4
   345
 */
williamr@4
   346
#ifndef _ABORT_DEFINED
williamr@4
   347
#  define _STLP_ABORT() TerminateProcess(reinterpret_cast<HANDLE>(66), 0)
williamr@4
   348
#  define _ABORT_DEFINED
williamr@4
   349
#endif
williamr@4
   350
williamr@4
   351
// Notice: windows.h isn't included here anymore; all needed defines are in
williamr@4
   352
// stl/_windows.h now
williamr@4
   353
williamr@4
   354
#endif /* _STLP_EVC_H */