os/ossrv/stdcpp/include/config/stl_wince.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/stdcpp/include/config/stl_wince.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,188 @@
     1.4 +/*
     1.5 + * File to have Windows CE Toolkit for VC++ 5.0 working with STLport
     1.6 + * 09 - 03 - 1999
     1.7 + * Origin : Giuseppe Govi - g.govi@iol.it
     1.8 + */
     1.9 +
    1.10 +#ifndef _STLP_WINCE_H
    1.11 +#define _STLP_WINCE_H
    1.12 +
    1.13 +// this flag is being used by STLport
    1.14 +#   define _STLP_WINCE
    1.15 +
    1.16 +#ifndef _MT                            // Always threaded in CE
    1.17 +  #define _MT
    1.18 +#endif
    1.19 +
    1.20 +#define _STLP_NO_NATIVE_MBSTATE_T
    1.21 +#define _STLP_NO_TYPEINFO
    1.22 +#define _STLP_NO_BAD_ALLOC
    1.23 +#define _STLP_NO_NEW_NEW_HEADER
    1.24 +#define _STLP_OWN_IOSTREAMS
    1.25 +
    1.26 +// tell other parts no threads are there
    1.27 +#   define _STLP_NO_THREADS 1
    1.28 +
    1.29 +// not all new-style headers are available...
    1.30 +# define _STLP_HAS_NO_NEW_C_HEADERS
    1.31 +
    1.32 +#     undef _STLP_HAS_NO_EXCEPTIONS
    1.33 +#     define _STLP_HAS_NO_EXCEPTIONS
    1.34 +#     undef _STLP_NO_EXCEPTION_HEADER
    1.35 +#     define _STLP_NO_EXCEPTION_HEADER
    1.36 +
    1.37 +// we have to use malloc instead of new
    1.38 +# undef  _STLP_USE_NEWALLOC
    1.39 +# define _STLP_USE_MALLOC
    1.40 +
    1.41 +//# ifdef _STLP_MSVC
    1.42 +//#     pragma warning (disable: 4786)
    1.43 +//# endif
    1.44 +
    1.45 +#ifdef _STLP_WINCE_USE_OUTPUTDEBUGSTRING
    1.46 +#define _STLP_WINCE_TRACE(msg)   OutputDebugString(msg)
    1.47 +#else
    1.48 +#define _STLP_WINCE_TRACE(msg)   MessageBox(NULL,(msg),NULL,MB_OK)
    1.49 +#endif
    1.50 +
    1.51 +#ifndef __THROW_BAD_ALLOC
    1.52 +#define __THROW_BAD_ALLOC _STLP_WINCE_TRACE(L"out of memory"); ExitThread(1)
    1.53 +#endif
    1.54 +
    1.55 +#ifndef _SIZE_T_DEFINED
    1.56 +typedef unsigned int size_t;
    1.57 +#define _SIZE_T_DEFINED
    1.58 +#endif
    1.59 +
    1.60 +#ifndef _WCHAR_T_DEFINED
    1.61 +typedef unsigned short wchar_t;
    1.62 +#define _WCHAR_T_DEFINED
    1.63 +#endif
    1.64 +
    1.65 +#ifndef _TIME_T_DEFINED
    1.66 +typedef unsigned long time_t;
    1.67 +#define _TIME_T_DEFINED
    1.68 +#endif
    1.69 +
    1.70 +//ptrdiff_t is not defined in Windows CE SDK
    1.71 +#ifndef _PTRDIFF_T_DEFINED
    1.72 +typedef int ptrdiff_t;
    1.73 +#define _PTRDIFF_T_DEFINED
    1.74 +#endif
    1.75 +
    1.76 +//clock_t is not defined in Windows CE SDK
    1.77 +#ifndef _CLOCK_T_DEFINED
    1.78 +typedef long clock_t;
    1.79 +#define _CLOCK_T_DEFINED
    1.80 +#endif
    1.81 +
    1.82 +//struct tm is not defined in Windows CE SDK
    1.83 +#ifndef _TM_DEFINED
    1.84 +struct tm {
    1.85 +        int tm_sec;     /* seconds after the minute - [0,59] */
    1.86 +        int tm_min;     /* minutes after the hour - [0,59] */
    1.87 +        int tm_hour;    /* hours since midnight - [0,23] */
    1.88 +        int tm_mday;    /* day of the month - [1,31] */
    1.89 +        int tm_mon;     /* months since January - [0,11] */
    1.90 +        int tm_year;    /* years since 1900 */
    1.91 +        int tm_wday;    /* days since Sunday - [0,6] */
    1.92 +        int tm_yday;    /* days since January 1 - [0,365] */
    1.93 +        int tm_isdst;   /* daylight savings time flag */
    1.94 +        };
    1.95 +#define _TM_DEFINED
    1.96 +#endif
    1.97 +
    1.98 +// Some useful routines that are missing in Windows CE SDK
    1.99 +#ifdef __cplusplus
   1.100 +extern "C"
   1.101 +{
   1.102 +#endif
   1.103 +
   1.104 +  char *      __cdecl getenv(const char *);
   1.105 +  struct tm * __cdecl gmtime(const time_t *);
   1.106 +  int         __cdecl remove(const char *);
   1.107 +  int         __cdecl rename(const char *, const char *);
   1.108 +  time_t      __cdecl time(time_t *);
   1.109 +
   1.110 +  #if (_WIN32_WCE < 300)
   1.111 +    char * __cdecl strrchr(const char *, int);
   1.112 +  #endif
   1.113 +
   1.114 +#ifdef __cplusplus
   1.115 +}
   1.116 +
   1.117 +#ifndef __PLACEMENT_NEW_INLINE
   1.118 +inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
   1.119 +#define __PLACEMENT_NEW_INLINE
   1.120 +#endif
   1.121 +
   1.122 +// Only defined as macros in Windows CE SDK
   1.123 +#include _STLP_NATIVE_C_HEADER(ctype.h)
   1.124 +
   1.125 +#if (_WIN32_WCE < 300)                  // Only wide chars for older versions
   1.126 +#define _isctype iswctype
   1.127 +#endif
   1.128 +
   1.129 +inline int (isalpha)(int c) { return _isctype(c, _ALPHA); }
   1.130 +inline int (isupper)(int c) { return _isctype(c, _UPPER); }
   1.131 +inline int (islower)(int c) { return _isctype(c, _LOWER); }
   1.132 +inline int (isdigit)(int c) { return _isctype(c, _DIGIT); }
   1.133 +inline int (isxdigit)(int c) { return _isctype(c, _HEX); }
   1.134 +inline int (isspace)(int c) { return _isctype(c, _SPACE); }
   1.135 +inline int (ispunct)(int c) { return _isctype(c, _PUNCT); }
   1.136 +inline int (isalnum)(int c) { return _isctype(c, _ALPHA|_DIGIT); }
   1.137 +inline int (isprint)(int c) { return _isctype(c, _BLANK|_PUNCT|_ALPHA|_DIGIT); }
   1.138 +inline int (isgraph)(int c) { return _isctype(c, _PUNCT|_ALPHA|_DIGIT); }
   1.139 +inline int (iscntrl)(int c) { return _isctype(c, _CONTROL); }
   1.140 +inline int (isascii)(int c) { return ((unsigned)(c) < 0x80); }
   1.141 +
   1.142 +#undef _isctype
   1.143 +
   1.144 +inline int (iswalpha)(int c) { return iswctype(c, _ALPHA); }
   1.145 +inline int (iswupper)(int c) { return iswctype(c, _UPPER); }
   1.146 +inline int (iswlower)(int c) { return iswctype(c, _LOWER); }
   1.147 +inline int (iswdigit)(int c) { return iswctype(c, _DIGIT); }
   1.148 +inline int (iswxdigit)(int c) { return iswctype(c, _HEX); }
   1.149 +inline int (iswspace)(int c) { return iswctype(c, _SPACE); }
   1.150 +inline int (iswpunct)(int c) { return iswctype(c, _PUNCT); }
   1.151 +inline int (iswalnum)(int c) { return iswctype(c, _ALPHA|_DIGIT); }
   1.152 +inline int (iswprint)(int c) { return iswctype(c, _BLANK|_PUNCT|_ALPHA|_DIGIT); }
   1.153 +inline int (iswgraph)(int c) { return iswctype(c, _PUNCT|_ALPHA|_DIGIT); }
   1.154 +inline int (iswcntrl)(int c) { return iswctype(c, _CONTROL); }
   1.155 +inline int (iswascii)(int c) { return ((unsigned)(c) < 0x80); }
   1.156 +
   1.157 +#endif /* __cplusplus */
   1.158 +
   1.159 +#if !defined(WIN32_LEAN_AND_MEAN)       // Minimise windows includes
   1.160 +  #define WIN32_LEAN_AND_MEAN
   1.161 +#endif
   1.162 +#if !defined(VC_EXTRALEAN)
   1.163 +  #define VC_EXTRALEAN
   1.164 +#endif
   1.165 +#if !defined(STRICT)
   1.166 +  #define STRICT
   1.167 +#endif
   1.168 +#if !defined(NOMINMAX)
   1.169 +  #define NOMINMAX
   1.170 +#endif
   1.171 +
   1.172 +#ifndef __WINDOWS__
   1.173 +#include <windows.h>
   1.174 +#endif
   1.175 +
   1.176 +#ifndef _ABORT_DEFINED
   1.177 +# define _STLP_ABORT() TerminateProcess(GetCurrentProcess(), 0)
   1.178 +# define _ABORT_DEFINED
   1.179 +#endif
   1.180 +
   1.181 +#ifndef _ASSERT_DEFINED
   1.182 +# define assert(expr) _STLP_ASSERT(expr)
   1.183 +# define _ASSERT_DEFINED
   1.184 +#endif
   1.185 +
   1.186 +// they say it's needed 
   1.187 +# include <windows.h>
   1.188 +
   1.189 +#endif /* _STLP_WCE_H */
   1.190 +
   1.191 +