19720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/*
29720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1999
39720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Boris Fomitchev
49720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
59720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * This material is provided "as is", with absolutely no warranty expressed
69720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * or implied. Any use is at your own risk.
79720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
89720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to use or copy this software for any purpose is hereby granted
99720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * without fee, provided the above notices are retained on all copies.
109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to modify the code and to distribute modified code is granted,
119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * provided the above notices are retained, and a notice that the code was
129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * modified is included with the above copyright notice.
139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_CWCHAR
179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_INTERNAL_CWCHAR
189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_WCE_EVC3)
209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  ifndef _STLP_INTERNAL_MBSTATE_T
219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    include <stl/_mbstate_t.h>
229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (__GNUC__)
25e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    if defined (_STLP_HAS_INCLUDE_NEXT)
26e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include_next <cstddef>
27e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    else
28e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include _STLP_NATIVE_CPP_C_HEADER(cstddef)
29e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    endif
309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if !defined (_STLP_NO_CWCHAR) && defined (_STLP_USE_NEW_C_HEADERS)
33e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    if defined (_STLP_HAS_INCLUDE_NEXT)
34e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include_next <cwchar>
35e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    else
36e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include _STLP_NATIVE_CPP_C_HEADER(cwchar)
37e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    endif
389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined (__OpenBSD__)
399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktypedef _BSD_WINT_T_ wint_t;
409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif /* __OpenBSD__ */
419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
42e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    if defined (__DMC__)
43e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      define __STDC_LIMIT_MACROS
44e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include <stdint.h> // WCHAR_MIN, WCHAR_MAX
45e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    endif
46e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  elif defined (_STLP_NO_WCHAR_T) || \
47e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott       (defined (__BORLANDC__) && (__BORLANDC__ < 0x570)) || \
489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block        defined (__OpenBSD__) || defined (__FreeBSD__) || \
499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block       (defined (__GNUC__) && (defined (__APPLE__) || defined ( __Lynx__ )))
50e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    if defined (_STLP_HAS_INCLUDE_NEXT)
51e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include_next <stddef.h>
52e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    else
53e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include _STLP_NATIVE_C_HEADER(stddef.h)
54e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    endif
559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined (__Lynx__)
569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      ifndef _WINT_T
579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktypedef long int wint_t;
589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        define _WINT_T
599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif /* _WINT_T */
609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined(__OpenBSD__)
629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktypedef _BSD_WINT_T_ wint_t;
639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif /* __OpenBSD__ */
64e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#  else
65e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    if defined (_STLP_HAS_INCLUDE_NEXT)
66e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include_next <wchar.h>
67e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    else
68e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      include _STLP_NATIVE_C_HEADER(wchar.h)
69e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    endif
709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined (__sun) && (defined (_XOPEN_SOURCE) || (_XOPEN_VERSION - 0 == 4))
729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern wint_t   btowc();
739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      fwprintf();
749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      fwscanf();
759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      fwide();
769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      mbsinit();
779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern size_t   mbrlen();
789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern size_t   mbrtowc();
799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern size_t   mbsrtowcs();
809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      swprintf();
819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      swscanf();
829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      vfwprintf();
839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      vwprintf();
849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      vswprintf();
859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern size_t   wcrtomb();
869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern size_t   wcsrtombs();
879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern wchar_t  *wcsstr();
889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      wctob();
899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern wchar_t  *wmemchr();
909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      wmemcmp();
919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern wchar_t  *wmemcpy();
929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern wchar_t  *wmemmove();
939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern wchar_t  *wmemset();
949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      wprintf();
959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockextern int      wscanf();
969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (__MSL__) && (__MSL__ <= 0x51FF)  /* dwa 2/28/99 - not yet implemented by MSL  */
1009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    define _STLP_WCHAR_MSL_EXCLUDE 1
1019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocknamespace std {
1029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  extern "C" size_t wcsftime(wchar_t * str, size_t max_size, const wchar_t * format_str, const struct tm * timeptr);
1039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block}
104e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    define _STLP_NO_NATIVE_MBSTATE_T 1
1059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  elif defined (__BORLANDC__)
1069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if !defined (_STLP_USE_NO_IOSTREAMS)
1079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      define _STLP_NO_NATIVE_MBSTATE_T
1089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
1099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    define _STLP_WCHAR_BORLAND_EXCLUDE 1
1109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
1119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  ifndef _STLP_INTERNAL_MBSTATE_T
1139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    include <stl/_mbstate_t.h>
1149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
1159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if !defined (_STLP_NO_WCHAR_T)
1179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    ifndef WCHAR_MIN
1189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      define WCHAR_MIN 0
1199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* SUNpro has some bugs with casts. wchar_t is size of int there anyway. */
1209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      if defined (__SUNPRO_CC) || defined (__DJGPP)
1219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        define WCHAR_MAX (~0)
1229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      else
1239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        define WCHAR_MAX ((wchar_t)~0)
1249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
1259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
126e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    if defined (__DMC__) || (defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB < 1400)) || defined(_WIN32_WCE)
127e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott/* Compilers that do not define WCHAR_MIN and WCHAR_MAX to be testable at
128e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott * preprocessing time. */
129e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      undef WCHAR_MIN
130e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      define WCHAR_MIN 0
131e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      undef WCHAR_MAX
132e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      define WCHAR_MAX 0xffff
133e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#    endif
1349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined (__GNUC__) && defined (__alpha__)
1359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* Definition of WCHAR_MIN and MAX are wrong for alpha platform
136e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott * as gcc consider wchar_t as an unsigned type but WCHAR_MIN is defined as
137e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott * a negative value. Static assertion is here to check that a future alpha
138e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott * SDK or a future gcc won't change the situation making this workaround
139e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott * useless.
1409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
141e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott/* Check that gcc still consider wchar_t as unsigned */
142e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott_STLP_STATIC_ASSERT(((wchar_t)-1 > 0))
143e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott/* Check that WCHAR_MIN value hasn't been fixed */
144e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott_STLP_STATIC_ASSERT((WCHAR_MIN < 0))
1459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      undef WCHAR_MIN
1469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      define WCHAR_MIN 0
1479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      undef WCHAR_MAX
148e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      define WCHAR_MAX 0xffffffff
1499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
1509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined(__HP_aCC) && (__HP_aCC >= 60000)
1519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* Starting with B.11.31, HP-UX/ia64 provides C99-compliant definitions
1529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * of WCHAR_MIN/MAX macros without having to define
1539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * _INCLUDE_STDC__SOURCE_199901 macro (which aCC compiler does not
1549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * predefine). Let STLport provide B.11.31 definitions on any version of
1559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * HP-UX/ia64.
1569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
1579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      undef WCHAR_MIN
1589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      define WCHAR_MIN 0
1599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      undef WCHAR_MAX
160e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      define WCHAR_MAX UINT_MAX
1619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
1629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
1639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_IMPORT_VENDOR_CSTD)
1659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined (__SUNPRO_CC) && !defined (_STLP_HAS_NO_NEW_C_HEADERS)
1679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wint_t;
1689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
1699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_BEGIN_NAMESPACE
1719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if defined (_STLP_NO_WCHAR_T)
1729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktypedef int wint_t;
1739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    else
1749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// gcc 3.0 has a glitch : wint_t only sucked into the global namespace if _GLIBCPP_USE_WCHAR_T is defined
1759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// __MWERKS__ has definition in wchar_t.h (MSL C++), but ones differ from definition
1769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// in stdio.h; I prefer settings from last file.
177e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      if (defined (__GNUC__) && ! defined (_GLIBCPP_USE_WCHAR_T))
1789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing ::wint_t;
1799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      else
1809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wint_t;
1819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
1829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif
1839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::size_t;
1859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if !defined (_STLP_NO_NATIVE_MBSTATE_T) && !defined (_STLP_USE_OWN_MBSTATE_T)
1879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::mbstate_t;
1889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) && !defined(_STLP_WCHAR_BORLAND_EXCLUDE) && \
1909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block         (!defined(__MSL__) || __MSL__ > 0x6001)
1919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        if defined (__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 8))) || \
192e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott          !(defined (__KCC) || defined (__GNUC__)) && !defined(_STLP_WCE_NET)
1939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::btowc;
1949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          if (!defined(__MSL__) || __MSL__ > 0x7001)
1959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::mbsinit;
1969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          endif
1979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
1989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        if defined (__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 3) || ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 8))) || \
199e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott           !defined (__GNUC__) && !defined(_STLP_WCE_NET)
2009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::mbrlen;
2019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::mbrtowc;
2029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::mbsrtowcs;
2039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::wcrtomb;
2049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_MB_NAMESPACE::wcsrtombs;
2059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
2069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif /* BORLAND && !__MSL__ || __MSL__ > 0x6001 */
2079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif /* _STLP_NO_NATIVE_MBSTATE_T */
2099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    if !defined (_STLP_NO_NATIVE_WIDE_FUNCTIONS) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
2119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
212e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      if !defined (_STLP_WCHAR_BORLAND_EXCLUDE) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
2139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fgetwc;
2149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fgetws;
2159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fputwc;
2169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fputws;
2179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
2189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      if !(defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE) || \
220e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott            defined(_STLP_WCHAR_HPACC_EXCLUDE) )
2219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        if !defined (__DECCXX)
2229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fwide;
2239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
2249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fwprintf;
2259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::fwscanf;
2269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::getwchar;
2279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
2289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
229e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      if !defined(_STLP_WCHAR_BORLAND_EXCLUDE)
2309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        ifndef _STLP_WCE_NET
2319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::getwc;
2329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
2339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::ungetwc;
2349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        ifndef _STLP_WCE_NET
2359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::putwc;
2369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
2379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::putwchar;
2389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
2399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      if !(defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE) || \
241e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott            defined (_STLP_WCHAR_HPACC_EXCLUDE) )
2429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        if defined (_STLP_MSVC_LIB) && (_STLP_MSVC_LIB <= 1300) || \
2439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block            defined (__MINGW32__)
2449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          undef swprintf
2459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          define swprintf _snwprintf
2469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          undef vswprintf
2479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          define vswprintf _vsnwprintf
2489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing ::swprintf;
2499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing ::vswprintf;
2509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        else
2519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::swprintf;
2529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::vswprintf;
2539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
2549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::swscanf;
2559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::vfwprintf;
2569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::vwprintf;
2579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        if (!defined(__MSL__) || __MSL__ > 0x7001 ) && !defined(_STLP_WCE_NET) && \
2599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block             !defined(_STLP_USE_UCLIBC) /* at least in uClibc 0.9.26 */
2609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsftime;
2629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
2639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcstok;
2649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
2669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
267e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      if !defined (_STLP_WCE_NET)
2689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcscoll;
2699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsxfrm;
270e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      endif
2719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcscat;
2729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsrchr;
2739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcscmp;
2749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcscpy;
2769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcscspn;
2779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcslen;
2799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsncat;
2809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsncmp;
2819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsncpy;
2829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcspbrk;
2839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcschr;
2849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsspn;
2869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
287e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
2889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcstod;
2899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcstol;
2909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
2919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
292e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#      if !(defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_HPACC_EXCLUDE) )
2939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wcsstr;
2949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wmemchr;
2959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
2979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#            if !defined (_STLP_WCE_NET)
2989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wctob;
2999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#            endif
3009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          if !defined (__DMC__)
3019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wmemcmp;
3029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wmemmove;
3039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          endif
3049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wprintf;
3059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wscanf;
3069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
3079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
308e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#        if defined (__BORLANDC__) && !defined (__linux__)
3099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* _STLP_wmemcpy(wchar_t* __wdst, const wchar_t* __wsrc, size_t __n)
3109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ return __STATIC_CAST(wchar_t*, _STLP_VENDOR_CSTD::wmemcpy(__wdst, __wsrc, __n)); }
3119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* _STLP_wmemset(wchar_t* __wdst, wchar_t __wc, size_t __n)
3129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ return __STATIC_CAST(wchar_t*, _STLP_VENDOR_CSTD::memset(__wdst, __wc, __n)); }
3139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          undef wmemcpy
3149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#          undef wmemset
3159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* wmemcpy(wchar_t* __wdst, const wchar_t* __wsrc, size_t __n)
3169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ return _STLP_wmemcpy(__wdst, __wsrc, __n); }
3179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* wmemset(wchar_t* __wdst, wchar_t __wc, size_t __n)
3189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ return _STLP_wmemset(__wdst, __wc, __n); }
3199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        elif defined (__DMC__)
3209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* wmemcpy(wchar_t* __RESTRICT __wdst, const wchar_t* __RESTRICT __wsrc, size_t __n)
3219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ return __STATIC_CAST(wchar_t*, memcpy(__wdst, __wsrc, __n * sizeof(wchar_t))); }
3229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* wmemmove(wchar_t* __RESTRICT __wdst, const wchar_t * __RESTRICT __wc, size_t __n)
3239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ return __STATIC_CAST(wchar_t*, memmove(__wdst, __wc, __n * sizeof(wchar_t))); }
3249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockinline wchar_t* wmemset(wchar_t* __wdst, wchar_t __wc, size_t __n)
3259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ for (size_t i = 0; i < __n; i++) __wdst[i] = __wc; return __wdst; }
3269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        else
3279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wmemcpy;
3289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockusing _STLP_VENDOR_CSTD::wmemset;
3299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#        endif
3309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#      endif
3319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#    endif /* _STLP_NO_NATIVE_WIDE_FUNCTIONS */
3339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_END_NAMESPACE
3349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif /* _STLP_IMPORT_VENDOR_CSTD */
3369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  undef _STLP_WCHAR_SUNPRO_EXCLUDE
3389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  undef _STLP_WCHAR_MSL_EXCLUDE
3399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif /* !defined(_STLP_WCE_EVC3) */
3419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
3429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_INTERNAL_CWCHAR */
343