/*
 * Copyright (c) 1999 
 * Boris Fomitchev
 *
 * This material is provided "as is", with absolutely no warranty expressed
 * or implied. Any use is at your own risk.
 *
 * Permission to use or copy this software for any purpose is hereby granted 
 * without fee, provided the above notices are retained on all copies.
 * Permission to modify the code and to distribute modified code is granted,
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.
 *
 */

#ifndef __STLPORT_CWCHAR

# ifndef __STL_CONFIG_H
#  include <stl_config.h>
# endif

# if defined  (__STL_USE_NEW_C_HEADERS) || defined (__IN_STLPORT_CWCHAR)
#  ifndef __IN_STLPORT_CWCHAR
#   define __STLPORT_CWCHAR
#  endif
#  include __STL_NATIVE_C_HEADER(cwchar)
# elif defined (__MRC__) || defined (__SC__) || defined (__BORLANDC__)
#  include <stddef.h>
# else
#  define __IN_STLPORT_CWCHAR
#  include <wchar.h>
#  undef  __IN_STLPORT_CWCHAR
# endif


#if !defined (__IN_STLPORT_CWCHAR)

// this stuff is varying a lot between platforms
#if defined(__MSL__) && __MSL__ <= 0x5012	// dwa 2/28/99 - not yet implemented by MSL 
#  define __STL_WCHAR_MSL_EXCLUDE 1
#  define __STL_NO_MBSTATE_T 1
#elif defined(__sun) && defined (__SVR4) && !defined (_MBSTATE_T) && !defined (_STD_MBSTATE_T)
// # if (defined(__SunOS_5_4) || defined(__SunOS_5_5) || defined(__SunOS_5_5_1) ||defined(__SunOS_5_6)) 
#  define __STL_WCHAR_SUNPRO_EXCLUDE 1
// #  define __STL_NO_MBSTATE 1
#   define _MBSTATE_T
#   define _STD_MBSTATE_T
// fbp : see if disabling works better
struct __mbstate_t {
  __mbstate_t() {}
  __mbstate_t(int __i) : __data(__i) {}
  char __data;
}; 
typedef __mbstate_t mbstate_t;
#elif defined (__BORLANDC__)
#  define __STL_NO_MBSTATE_T 1
#  define __STL_WCHAR_BORLAND_EXCLUDE 1
#endif

// dwa 2/28/99 - Fix an MSL bug. We expect this to be fixed in the next release.
# if defined(__STL_WCHAR_MSL_EXCLUDE)
namespace std
{ 
  extern "C" size_t wcsftime(wchar_t * str, size_t max_size, const wchar_t * format_str, const struct tm * timeptr);
}
# endif

# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE

using __STL_VENDOR_CSTD::wint_t;
using __STL_VENDOR_CSTD::size_t;

#  ifndef __STL_NO_MBSTATE_T
using __STL_VENDOR_CSTD::mbstate_t;
#  endif

#  if !defined (__STL_NO_MBSTATE_T)
using __STL_VENDOR_CSTD::btowc;
using __STL_VENDOR_CSTD::mbrlen;
using __STL_VENDOR_CSTD::mbrtowc;
using __STL_VENDOR_CSTD::mbsinit;
using __STL_VENDOR_CSTD::mbsrtowcs;
using __STL_VENDOR_CSTD::wcrtomb;
using __STL_VENDOR_CSTD::wcsrtombs;
#  endif

# ifndef __STL_WCHAR_BORLAND_EXCLUDE
using __STL_VENDOR_CSTD::fgetwc;
using __STL_VENDOR_CSTD::fgetws;
using __STL_VENDOR_CSTD::fputwc;
using __STL_VENDOR_CSTD::fputws;
# endif

#  if !( defined (__STL_WCHAR_SUNPRO_EXCLUDE) || defined (__STL_WCHAR_BORLAND_EXCLUDE)) 
using __STL_VENDOR_CSTD::fwide;
using __STL_VENDOR_CSTD::fwprintf;
using __STL_VENDOR_CSTD::fwscanf;
using __STL_VENDOR_CSTD::getwchar;
#  endif

# ifndef __STL_WCHAR_BORLAND_EXCLUDE
using __STL_VENDOR_CSTD::getwc;
using __STL_VENDOR_CSTD::ungetwc;

using __STL_VENDOR_CSTD::putwc;
using __STL_VENDOR_CSTD::putwchar;
# endif

#  if !( defined (__STL_WCHAR_SUNPRO_EXCLUDE) || defined (__STL_WCHAR_BORLAND_EXCLUDE)) 
using __STL_VENDOR_CSTD::swprintf;
using __STL_VENDOR_CSTD::swscanf;
using __STL_VENDOR_CSTD::vfwprintf;
using __STL_VENDOR_CSTD::vwprintf;
using __STL_VENDOR_CSTD::vswprintf;

using __STL_VENDOR_CSTD::wcsftime;
using __STL_VENDOR_CSTD::wcstok;

#  endif

using __STL_VENDOR_CSTD::wcscat;
using __STL_VENDOR_CSTD::wcsrchr;
using __STL_VENDOR_CSTD::wcscmp;
using __STL_VENDOR_CSTD::wcscoll;

using __STL_VENDOR_CSTD::wcscpy;
using __STL_VENDOR_CSTD::wcscspn;

using __STL_VENDOR_CSTD::wcslen;
using __STL_VENDOR_CSTD::wcsncat;
using __STL_VENDOR_CSTD::wcsncmp;
using __STL_VENDOR_CSTD::wcsncpy;
using __STL_VENDOR_CSTD::wcspbrk;
using __STL_VENDOR_CSTD::wcschr;

using __STL_VENDOR_CSTD::wcsspn;
using __STL_VENDOR_CSTD::wcsxfrm;

#  if !defined (__STL_WCHAR_BORLAND_EXCLUDE)

using __STL_VENDOR_CSTD::wcstod;
using __STL_VENDOR_CSTD::wcstol;

# endif

#  ifndef __STL_WCHAR_SUNPRO_EXCLUDE

using __STL_VENDOR_CSTD::wcsstr;
using __STL_VENDOR_CSTD::wmemchr;

#  if !defined (__STL_WCHAR_BORLAND_EXCLUDE)

using __STL_VENDOR_CSTD::wctob;
using __STL_VENDOR_CSTD::wmemcmp;
using __STL_VENDOR_CSTD::wmemmove;
using __STL_VENDOR_CSTD::wprintf;
using __STL_VENDOR_CSTD::wscanf;

#  endif

using __STL_VENDOR_CSTD::wmemcpy;
using __STL_VENDOR_CSTD::wmemset;
#  endif

__STL_END_NAMESPACE

# endif /* __STL_IMPORT_VENDOR_CSTD */

#endif /* __IN_STLPORT_CWCHAR */

#ifndef __STLPORT_CWCHAR
# define __STLPORT_CWCHAR
#endif

# undef __STL_WCHAR_SUNPRO_EXCLUDE
# undef __STL_WCHAR_MSL_EXCLUDE
// # undef __STL_NO_MBSTATE_T

#endif /* __STLPORT_CWCHAR */

// Local Variables:
// mode:C++
// End:
