epoc32/include/stdapis/stlport/stl/_cwchar.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
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
 * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
williamr@4
     3
 * Copyright (c) 1999
williamr@4
     4
 * Boris Fomitchev
williamr@4
     5
 *
williamr@4
     6
 * This material is provided "as is", with absolutely no warranty expressed
williamr@4
     7
 * or implied. Any use is at your own risk.
williamr@4
     8
 *
williamr@4
     9
 * Permission to use or copy this software for any purpose is hereby granted 
williamr@4
    10
 * without fee, provided the above notices are retained on all copies.
williamr@4
    11
 * Permission to modify the code and to distribute modified code is granted,
williamr@4
    12
 * provided the above notices are retained, and a notice that the code was
williamr@4
    13
 * modified is included with the above copyright notice.
williamr@4
    14
 *
williamr@4
    15
 */
williamr@4
    16
williamr@4
    17
#ifndef _STLP_CWCHAR_H
williamr@4
    18
# define _STLP_CWCHAR_H
williamr@4
    19
williamr@4
    20
#ifndef _STLP_NO_WCHAR_T
williamr@4
    21
#ifdef __cplusplus
williamr@4
    22
# include <cwchar>
williamr@4
    23
#else
williamr@4
    24
# include <wchar.h>
williamr@4
    25
#endif
williamr@4
    26
#endif
williamr@4
    27
williamr@4
    28
# if defined (__MRC__) || defined (__SC__) || defined (__BORLANDC__) || defined(__FreeBSD__) || (defined (__GNUC__) && defined (__APPLE__) || defined( __Lynx__ )) || defined (_STLP_NO_WCHAR_T)
williamr@4
    29
williamr@4
    30
#ifdef __SYMBIAN32__
williamr@4
    31
#  include <stddef.h>
williamr@4
    32
#else
williamr@4
    33
# include _STLP_NATIVE_C_HEADER(stddef.h)
williamr@4
    34
#endif
williamr@4
    35
#  if defined (__FreeBSD__) || defined (__Lynx__)
williamr@4
    36
#   ifndef _WINT_T
williamr@4
    37
typedef long int wint_t;
williamr@4
    38
#    define _WINT_T
williamr@4
    39
#   endif /* _WINT_T */
williamr@4
    40
#  endif
williamr@4
    41
# endif
williamr@4
    42
williamr@4
    43
# if defined ( _STLP_OWN_IOSTREAMS ) && defined (_STLP_NO_NATIVE_MBSTATE_T) && ! defined (_STLP_NO_MBSTATE_T) && ! defined (_MBSTATE_T) && ! defined (__mbstate_t_defined)
williamr@4
    44
#  define _STLP_USE_OWN_MBSTATE_T
williamr@4
    45
#  define _MBSTATE_T
williamr@4
    46
# endif
williamr@4
    47
williamr@4
    48
# ifdef _STLP_USE_OWN_MBSTATE_T
williamr@4
    49
williamr@4
    50
#ifndef __SYMBIAN32__ //no more using the structure __stl_mbstate_t. usinfg _mb_state_t from _types.h.
williamr@4
    51
// to be compatible across different SUN platforms
williamr@4
    52
#ifdef __sun
williamr@4
    53
# define __stl_mbstate_t __mbstate_t
williamr@4
    54
#endif
williamr@4
    55
williamr@4
    56
struct __stl_mbstate_t;
williamr@4
    57
williamr@4
    58
# ifdef __cplusplus
williamr@4
    59
struct __stl_mbstate_t { 
williamr@4
    60
  __stl_mbstate_t( long __st = 0 ) { _M_state[0] = __st ; }
williamr@4
    61
  __stl_mbstate_t& operator=(const long __st) {
williamr@4
    62
    _M_state[0] = __st;              
williamr@4
    63
    return *this;
williamr@4
    64
  } 
williamr@4
    65
  __stl_mbstate_t(const __stl_mbstate_t& __x) {_M_state[0]= __x._M_state[0]; }         
williamr@4
    66
  __stl_mbstate_t& operator=(const __stl_mbstate_t& __x) {
williamr@4
    67
    _M_state[0]= __x._M_state[0];              
williamr@4
    68
    return *this;
williamr@4
    69
  }
williamr@4
    70
# if defined (__sun)
williamr@4
    71
#  ifdef _LP64
williamr@4
    72
  long _M_state[4];
williamr@4
    73
#  else
williamr@4
    74
  int _M_state[6];
williamr@4
    75
#  endif
williamr@4
    76
# else       
williamr@4
    77
  long _M_state[1];
williamr@4
    78
# endif
williamr@4
    79
};          
williamr@4
    80
williamr@4
    81
inline bool operator==(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
williamr@4
    82
  return ( __x._M_state[0] == __y._M_state[0] );
williamr@4
    83
}
williamr@4
    84
williamr@4
    85
inline bool operator!=(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
williamr@4
    86
  return ( __x._M_state[0] == __y._M_state[0] );
williamr@4
    87
}
williamr@4
    88
# endif
williamr@4
    89
williamr@4
    90
williamr@4
    91
#endif //#if __SYMBIAN32__
williamr@4
    92
_STLP_BEGIN_NAMESPACE
williamr@4
    93
//typedef __mbstate_t __stl_mbstate_t;
williamr@4
    94
//typedef __mbstate_t mbstate_t;
williamr@4
    95
williamr@4
    96
_STLP_END_NAMESPACE
williamr@4
    97
williamr@4
    98
# endif /* _STLP_USE_OWN_MBSTATE_T */
williamr@4
    99
williamr@4
   100
#if !defined (_STLP_NO_WCHAR_T)
williamr@4
   101
# ifndef WCHAR_MIN
williamr@4
   102
#  define WCHAR_MIN 0
williamr@4
   103
// SUNpro has some bugs with casts. wchar_t is size of int there anyway.
williamr@4
   104
#  if defined (__SUNPRO_CC) || defined (__DJGPP)
williamr@4
   105
#   define WCHAR_MAX (~0)
williamr@4
   106
#  else
williamr@4
   107
#   define WCHAR_MAX ((wchar_t)~0)
williamr@4
   108
#  endif
williamr@4
   109
# endif
williamr@4
   110
#endif
williamr@4
   111
williamr@4
   112
# if defined  (_STLP_IMPORT_VENDOR_CSTD) && ! defined (_STLP_VENDOR_GLOBAL_CSTD)
williamr@4
   113
_STLP_BEGIN_NAMESPACE  
williamr@4
   114
using namespace _STLP_VENDOR_CSTD;
williamr@4
   115
_STLP_END_NAMESPACE
williamr@4
   116
#endif /* _STLP_IMPORT_VENDOR_CSTD */
williamr@4
   117
williamr@4
   118
#endif /* _STLP_CWCHAR_H */
williamr@4
   119