// cwchar standard header
#ifndef _CWCHAR_
#define _CWCHAR_

#if defined(__ghs) || defined(__SC3__)

#if defined(__ghs)
// Ensure that __USE_ISOC99 is defined now, if it will be defined at all.
// On Linux, <yvals.h> includes <features.h> (which may define __USE_ISOC99).
#include <yvals.h>
#endif

#if defined(__LINUX) && !defined(__USE_ISOC99)
#define __clear_USE_ISOC99
#define __USE_ISOC99
#endif

 #include <wchar.h>

#if defined(__clear_USE_ISOC99)
#undef  __clear_USE_ISOC99
#undef  __USE_ISOC99
#endif

#if defined(__NAMESPACES) && !defined(__EMBEDDED_CXX_HEADERS)
namespace std {
    using ::size_t;
    using ::tm;
#if !defined(_SOLARIS_MINIMAL_WCHAR_H)
    using ::btowc;
    using ::wctob;
    using ::mbrlen;
    using ::mbrtowc;
    using ::mbsinit;
    using ::mbsrtowcs;
    using ::wcrtomb;
    using ::wcsrtombs;
#endif /* _SOLARIS_MINIMAL_WCHAR_H */
    using ::fgetwc;
    using ::fputwc;
    using ::ungetwc;
#if !(defined(__LINUX) && defined(__GLIBC__) && (((__GLIBC__ << 8) +__GLIBC_MINOR__) < 0x0202))
    using ::getwc;
    using ::getwchar;
    using ::putwc;
    using ::putwchar;
    using ::fgetws;
    using ::fputws;
#if !defined(_SOLARIS_MINIMAL_WCHAR_H)
    using ::fwide;
    using ::fwprintf;
    using ::fwscanf;
    using ::wprintf;
    using ::wscanf;
    using ::swprintf;
    using ::swscanf;
#endif /* _SOLARIS_MINIMAL_WCHAR_H */
/* these will only be defined if <stdarg.h> precedes wchar.h */
#if !(defined(__sparc) && defined(__VXWORKS)) && defined(va_end)
/* these are not available on older solaris (like 2.6) */
#if !defined(_SOLARIS_MINIMAL_WCHAR_H)
    using ::vfwprintf;
    using ::vswprintf;
    using ::vwprintf;
#endif /* _SOLARIS_MINIMAL_WCHAR_H */
#if !defined(__sun) && !defined(_WIN32)
    using ::vfwscanf;
    using ::vswscanf;
    using ::vwscanf;
#endif	/* !__sun && !_WIN32 */
#endif	/* !(__sparc && __VXWORKS) && va_end */
    using ::wcsftime;
#endif	/* __LINUX__ && __GLIBC__ < 2.2 */
    using ::wcscat;
    using ::wcschr;
    using ::wcscmp;
    using ::wcscoll;
    using ::wcscpy;
    using ::wcscspn;
    using ::wcslen;
    using ::wcsncat;
    using ::wcsncmp;
    using ::wcsncpy;
    using ::wcspbrk;
    using ::wcsrchr;
    using ::wcsspn;
#ifndef __NoFloat
    using ::wcstod;
#endif	/* __NoFloat */
    using ::wcstok;
    using ::wcstol;
/* long double not supported
    using ::wcstold;
*/
    using ::wcstoul;
#if !defined(__sun) && !defined(_WIN32) && \
	!(defined(__LINUX) && defined(__GLIBC__) && (((__GLIBC__ << 8) +__GLIBC_MINOR__) < 0x0202))
#ifndef __NoFloat
    using ::wcstof;
#endif	/* __NoFloat */
#ifdef __LLONG_BIT
    using ::wcstoll;
    using ::wcstoull;
#endif	/* __LLONG_BIT */
#endif /* !__sun && !_WIN32 && !(__LINUX && __GLIBC__ < 2.2) */
    using ::wcsxfrm;
#if !defined(_SOLARIS_MINIMAL_WCHAR_H)
    using ::wcsstr;
#endif /* _SOLARIS_MINIMAL_WCHAR_H */
    using ::wmemchr;
    using ::wmemcmp;
    using ::wmemcpy;
    using ::wmemmove;
    using ::wmemset;
    using ::mbstate_t;
    using ::wint_t;
}
#endif /* defined(__NAMESPACES) && !defined(__EMBEDDED_CXX_HEADERS) */

#else /* !__ghs */

#include <yvals.h>

#ifdef _STD_USING
 #undef _STD_USING
  #include <wchar.h>
 #define _STD_USING

typedef mbstate_t _Mbstatet;

#else /* _STD_USING */
 #include <wchar.h>

#ifndef WCHAR_MAX
 #define WCHAR_MAX	0x7fff
#endif /* WCHAR_MAX */

#ifndef WCHAR_MIN
 #define WCHAR_MIN	0
#endif /* WCHAR_MIN */


 #if defined(__BORLANDC__)	/* compiler test */
_STD_BEGIN
struct tm;
_STD_END

_C_STD_BEGIN
_C_LIB_DECL
using std::tm;

typedef int _Mbstatet;
typedef int mbstate_t;

//size_t wcslen(const wchar_t *);
//const wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
int wmemcmp(const wchar_t *, const wchar_t *, size_t);
//wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t);
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
//wchar_t *wmemset(wchar_t *, wchar_t, size_t);

wint_t btowc(int);
size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
int wctob(wint_t);
size_t wcrtomb(char *, wchar_t, mbstate_t *);
_END_C_LIB_DECL
_C_STD_END

 #else /* defined(__BORLANDC__) */
#if defined(__ghs) || defined(__SC3__)
typedef int _Mbstatet;
#else /* !__ghs */
typedef mbstate_t _Mbstatet;
#endif /* !__ghs */
 #endif /* defined(__BORLANDC__) */

 #ifdef _GLOBAL_USING
_STD_BEGIN

 #if defined(__APPLE__)	/* compiler test */

 #else /* defined(__APPLE__) */
#if !(defined(__ghs) || defined(__SC3__)) || !_IS_EMBEDDED
using _CSTD mbstate_t; 
#endif /* !__ghs || !_IS_EMBEDDED */
using _CSTD size_t; using _CSTD tm; using _CSTD wint_t;
 #endif /* defined(__APPLE__) */

 #if defined(__GLIBC__) && !defined(__APPLE__) && !defined(__ghs) 
							/* compiler test */

 #if __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 2
// using _CSTD fgetwc; using _CSTD fgetws; using _CSTD fputwc;
// using _CSTD fputws; using _CSTD getwc; using _CSTD getwchar;
// using _CSTD putwc; using _CSTD putwchar; using _CSTD ungetwc;

 #else /* __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 */
using _CSTD fgetwc; using _CSTD fgetws; using _CSTD fputwc;
using _CSTD fputws; using _CSTD getwc; using _CSTD getwchar;
using _CSTD putwc; using _CSTD putwchar; using _CSTD ungetwc;
 #endif /* __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 */

using _CSTD btowc;
// using _CSTD fwide; using _CSTD fwprintf;
// using _CSTD fwscanf;
using _CSTD mbrlen; using _CSTD mbrtowc; using _CSTD mbsrtowcs;
using _CSTD mbsinit;
// using _CSTD swprintf; using _CSTD swscanf;
// using _CSTD vfwprintf; using _CSTD vswprintf; using _CSTD vwprintf;
using _CSTD wcrtomb;
// using _CSTD wprintf; using _CSTD wscanf;
using _CSTD wcsrtombs; using _CSTD wcstol; using _CSTD wcscat;
using _CSTD wcschr; using _CSTD wcscmp; using _CSTD wcscoll;
using _CSTD wcscpy; using _CSTD wcscspn; using _CSTD wcslen;
using _CSTD wcsncat; using _CSTD wcsncmp; using _CSTD wcsncpy;
using _CSTD wcspbrk; using _CSTD wcsrchr; using _CSTD wcsspn;
using _CSTD wcstod; using _CSTD wcstoul; using _CSTD wcsstr;
using _CSTD wcstok; using _CSTD wcsxfrm; using _CSTD wctob;
using _CSTD wmemchr; using _CSTD wmemcmp; using _CSTD wmemcpy;
using _CSTD wmemmove; using _CSTD wmemset;
// using _CSTD wcsftime;
 #endif /* defined(__GLIBC__) etc. */

 #if defined(__GLIBC__) || defined(__BORLANDC__)	/* compiler test */ \
	|| defined(__APPLE__) || defined(__MINGW32__)

 #else /* defined(__GLIBC__) etc. */
using _CSTD btowc; using _CSTD fgetwc; using _CSTD fgetws; using _CSTD fputwc;
using _CSTD fputws; using _CSTD fwide; using _CSTD fwprintf;
using _CSTD fwscanf; using _CSTD getwc; using _CSTD getwchar;
using _CSTD mbrlen; using _CSTD mbrtowc; using _CSTD mbsrtowcs;
using _CSTD mbsinit; using _CSTD putwc; using _CSTD putwchar;
using _CSTD swprintf; using _CSTD swscanf; using _CSTD ungetwc;
#if defined(__ghs__)
using _CSTD vfwprintf; using _CSTD vswprintf; using _CSTD vwprintf;
#endif
using _CSTD wcrtomb; using _CSTD wprintf; using _CSTD wscanf;
using _CSTD wcsrtombs; using _CSTD wcstol; using _CSTD wcscat;
using _CSTD wcschr; using _CSTD wcscmp; using _CSTD wcscoll;
using _CSTD wcscpy; using _CSTD wcscspn; using _CSTD wcslen;
using _CSTD wcsncat; using _CSTD wcsncmp; using _CSTD wcsncpy;
using _CSTD wcspbrk; using _CSTD wcsrchr; using _CSTD wcsspn;
using _CSTD wcstod; using _CSTD wcstoul; using _CSTD wcsstr;
using _CSTD wcstok; using _CSTD wcsxfrm; using _CSTD wctob;
using _CSTD wmemchr; using _CSTD wmemcmp; using _CSTD wmemcpy;
using _CSTD wmemmove; using _CSTD wmemset; using _CSTD wcsftime;
 #endif /* defined(__GLIBC__) etc. */

 #if _HAS_C9X
using _CSTD vfwscanf; using _CSTD vswscanf; using _CSTD vwscanf;
using _CSTD wcstof; using _CSTD wcstold;
using _CSTD wcstoll; using _CSTD wcstoull;
 #endif /* _HAS_C9X */

_STD_END
 #endif /* _GLOBAL_USING */

#endif /* _STD_USING */
#endif /* !__ghs */
#endif /* _CWCHAR_ */

/*
 * Copyright (c) 1992-2003 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V4.02:0324 */
