epoc32/include/stdapis/stlport/stl/_cwchar.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/stl/_cwchar.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/stl/_cwchar.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,119 @@
     1.4 -_cwchar.h
     1.5 +/*
     1.6 + * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
     1.7 + * Copyright (c) 1999
     1.8 + * Boris Fomitchev
     1.9 + *
    1.10 + * This material is provided "as is", with absolutely no warranty expressed
    1.11 + * or implied. Any use is at your own risk.
    1.12 + *
    1.13 + * Permission to use or copy this software for any purpose is hereby granted 
    1.14 + * without fee, provided the above notices are retained on all copies.
    1.15 + * Permission to modify the code and to distribute modified code is granted,
    1.16 + * provided the above notices are retained, and a notice that the code was
    1.17 + * modified is included with the above copyright notice.
    1.18 + *
    1.19 + */
    1.20 +
    1.21 +#ifndef _STLP_CWCHAR_H
    1.22 +# define _STLP_CWCHAR_H
    1.23 +
    1.24 +#ifndef _STLP_NO_WCHAR_T
    1.25 +#ifdef __cplusplus
    1.26 +# include <cwchar>
    1.27 +#else
    1.28 +# include <wchar.h>
    1.29 +#endif
    1.30 +#endif
    1.31 +
    1.32 +# if defined (__MRC__) || defined (__SC__) || defined (__BORLANDC__) || defined(__FreeBSD__) || (defined (__GNUC__) && defined (__APPLE__) || defined( __Lynx__ )) || defined (_STLP_NO_WCHAR_T)
    1.33 +
    1.34 +#ifdef __SYMBIAN32__
    1.35 +#  include <stddef.h>
    1.36 +#else
    1.37 +# include _STLP_NATIVE_C_HEADER(stddef.h)
    1.38 +#endif
    1.39 +#  if defined (__FreeBSD__) || defined (__Lynx__)
    1.40 +#   ifndef _WINT_T
    1.41 +typedef long int wint_t;
    1.42 +#    define _WINT_T
    1.43 +#   endif /* _WINT_T */
    1.44 +#  endif
    1.45 +# endif
    1.46 +
    1.47 +# if defined ( _STLP_OWN_IOSTREAMS ) && defined (_STLP_NO_NATIVE_MBSTATE_T) && ! defined (_STLP_NO_MBSTATE_T) && ! defined (_MBSTATE_T) && ! defined (__mbstate_t_defined)
    1.48 +#  define _STLP_USE_OWN_MBSTATE_T
    1.49 +#  define _MBSTATE_T
    1.50 +# endif
    1.51 +
    1.52 +# ifdef _STLP_USE_OWN_MBSTATE_T
    1.53 +
    1.54 +#ifndef __SYMBIAN32__ //no more using the structure __stl_mbstate_t. usinfg _mb_state_t from _types.h.
    1.55 +// to be compatible across different SUN platforms
    1.56 +#ifdef __sun
    1.57 +# define __stl_mbstate_t __mbstate_t
    1.58 +#endif
    1.59 +
    1.60 +struct __stl_mbstate_t;
    1.61 +
    1.62 +# ifdef __cplusplus
    1.63 +struct __stl_mbstate_t { 
    1.64 +  __stl_mbstate_t( long __st = 0 ) { _M_state[0] = __st ; }
    1.65 +  __stl_mbstate_t& operator=(const long __st) {
    1.66 +    _M_state[0] = __st;              
    1.67 +    return *this;
    1.68 +  } 
    1.69 +  __stl_mbstate_t(const __stl_mbstate_t& __x) {_M_state[0]= __x._M_state[0]; }         
    1.70 +  __stl_mbstate_t& operator=(const __stl_mbstate_t& __x) {
    1.71 +    _M_state[0]= __x._M_state[0];              
    1.72 +    return *this;
    1.73 +  }
    1.74 +# if defined (__sun)
    1.75 +#  ifdef _LP64
    1.76 +  long _M_state[4];
    1.77 +#  else
    1.78 +  int _M_state[6];
    1.79 +#  endif
    1.80 +# else       
    1.81 +  long _M_state[1];
    1.82 +# endif
    1.83 +};          
    1.84 +
    1.85 +inline bool operator==(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
    1.86 +  return ( __x._M_state[0] == __y._M_state[0] );
    1.87 +}
    1.88 +
    1.89 +inline bool operator!=(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
    1.90 +  return ( __x._M_state[0] == __y._M_state[0] );
    1.91 +}
    1.92 +# endif
    1.93 +
    1.94 +
    1.95 +#endif //#if __SYMBIAN32__
    1.96 +_STLP_BEGIN_NAMESPACE
    1.97 +//typedef __mbstate_t __stl_mbstate_t;
    1.98 +//typedef __mbstate_t mbstate_t;
    1.99 +
   1.100 +_STLP_END_NAMESPACE
   1.101 +
   1.102 +# endif /* _STLP_USE_OWN_MBSTATE_T */
   1.103 +
   1.104 +#if !defined (_STLP_NO_WCHAR_T)
   1.105 +# ifndef WCHAR_MIN
   1.106 +#  define WCHAR_MIN 0
   1.107 +// SUNpro has some bugs with casts. wchar_t is size of int there anyway.
   1.108 +#  if defined (__SUNPRO_CC) || defined (__DJGPP)
   1.109 +#   define WCHAR_MAX (~0)
   1.110 +#  else
   1.111 +#   define WCHAR_MAX ((wchar_t)~0)
   1.112 +#  endif
   1.113 +# endif
   1.114 +#endif
   1.115 +
   1.116 +# if defined  (_STLP_IMPORT_VENDOR_CSTD) && ! defined (_STLP_VENDOR_GLOBAL_CSTD)
   1.117 +_STLP_BEGIN_NAMESPACE  
   1.118 +using namespace _STLP_VENDOR_CSTD;
   1.119 +_STLP_END_NAMESPACE
   1.120 +#endif /* _STLP_IMPORT_VENDOR_CSTD */
   1.121 +
   1.122 +#endif /* _STLP_CWCHAR_H */
   1.123 +