2 * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
6 * This material is provided "as is", with absolutely no warranty expressed
7 * or implied. Any use is at your own risk.
9 * Permission to use or copy this software for any purpose is hereby granted
10 * without fee, provided the above notices are retained on all copies.
11 * Permission to modify the code and to distribute modified code is granted,
12 * provided the above notices are retained, and a notice that the code was
13 * modified is included with the above copyright notice.
17 #ifndef _STLP_CWCHAR_H
18 # define _STLP_CWCHAR_H
20 #ifndef _STLP_NO_WCHAR_T
28 # if defined (__MRC__) || defined (__SC__) || defined (__BORLANDC__) || defined(__FreeBSD__) || (defined (__GNUC__) && defined (__APPLE__) || defined( __Lynx__ )) || defined (_STLP_NO_WCHAR_T)
33 # include _STLP_NATIVE_C_HEADER(stddef.h)
35 # if defined (__FreeBSD__) || defined (__Lynx__)
37 typedef long int wint_t;
43 # if defined ( _STLP_OWN_IOSTREAMS ) && defined (_STLP_NO_NATIVE_MBSTATE_T) && ! defined (_STLP_NO_MBSTATE_T) && ! defined (_MBSTATE_T) && ! defined (__mbstate_t_defined)
44 # define _STLP_USE_OWN_MBSTATE_T
48 # ifdef _STLP_USE_OWN_MBSTATE_T
50 #ifndef __SYMBIAN32__ //no more using the structure __stl_mbstate_t. usinfg _mb_state_t from _types.h.
51 // to be compatible across different SUN platforms
53 # define __stl_mbstate_t __mbstate_t
56 struct __stl_mbstate_t;
59 struct __stl_mbstate_t {
60 __stl_mbstate_t( long __st = 0 ) { _M_state[0] = __st ; }
61 __stl_mbstate_t& operator=(const long __st) {
65 __stl_mbstate_t(const __stl_mbstate_t& __x) {_M_state[0]= __x._M_state[0]; }
66 __stl_mbstate_t& operator=(const __stl_mbstate_t& __x) {
67 _M_state[0]= __x._M_state[0];
81 inline bool operator==(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
82 return ( __x._M_state[0] == __y._M_state[0] );
85 inline bool operator!=(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
86 return ( __x._M_state[0] == __y._M_state[0] );
91 #endif //#if __SYMBIAN32__
93 //typedef __mbstate_t __stl_mbstate_t;
94 //typedef __mbstate_t mbstate_t;
98 # endif /* _STLP_USE_OWN_MBSTATE_T */
100 #if !defined (_STLP_NO_WCHAR_T)
103 // SUNpro has some bugs with casts. wchar_t is size of int there anyway.
104 # if defined (__SUNPRO_CC) || defined (__DJGPP)
105 # define WCHAR_MAX (~0)
107 # define WCHAR_MAX ((wchar_t)~0)
112 # if defined (_STLP_IMPORT_VENDOR_CSTD) && ! defined (_STLP_VENDOR_GLOBAL_CSTD)
113 _STLP_BEGIN_NAMESPACE
114 using namespace _STLP_VENDOR_CSTD;
116 #endif /* _STLP_IMPORT_VENDOR_CSTD */
118 #endif /* _STLP_CWCHAR_H */