/** -*- C++ -*-
 **
 **  KAI C++ Compiler
 **
 **  Copyright (C) 1996-1997, Kuck & Associates, Inc. All rights reserved.
 **/
#ifndef __KAI_CWCHAR
#define __KAI_CWCHAR

#include <wchar.h>

#if defined(__hpux) || defined(__SR8000)
/* KCC 3.4 does not yet implement multibyte strings, as HP/UX does not either,
   so the typedef is just hypothetical. */
typedef char mbstate_t;
#endif /* __hpux */

#ifdef __sparc
/* KCC 3.4 does not implement mbstate_t, as Solaris 2.6 does not either.
   Solaris 2.7 does define mbstate_t, so for sake of future implementation,
   mimic Solaris 2.7's definition. */

#ifdef _MBSTATE_T 
/* Must be Solaris 2.7, which defines _MBSTATET_T and declares mbstate_t */
#else
/* Must be earlier version of Solaris. */
#define _MBSTATE_T

/* Solaris 2.7 appears to have oversight in that definition of __mbstate_t is dependent on 
   macro _MBSTATET_H, but the latter is never defined by the Solaris headers. 
   Thus we have to rely on using _MBSTATE_T as the guard (above). */
struct __mbstate_t {
#if defined(_LP64)
    long field[4];
#else
    int field[6];
#endif
};

/* We must typedef mbstate_t to the name __mbstate_t, so that the latter is used for
   template name mangling.  Otherwise we would have a gratuitous link incompatibility
   between Solaris 2.6 and Solaris 2.7. */
typedef __mbstate_t mbstate_t;		
#endif /* _MBSTATET_H */
#endif /* __sparc */

#ifdef _AIX
typedef char *   mbstate_t;	/* What AIX 4.3 uses */
#endif /* _AIX */

#endif /* __KAI_CWCHAR */
