/* Copyright 1992 NEC Corporation, Tokyo, Japan.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without
 * fee, provided that the above copyright notice appear in all copies
 * and that both that copyright notice and this permission notice
 * appear in supporting documentation, and that the name of NEC
 * Corporation not be used in advertising or publicity pertaining to
 * distribution of the software without specific, written prior
 * permission.  NEC Corporation makes no representations about the
 * suitability of this software for any purpose.  It is provided "as
 * is" without express or implied warranty.
 *
 * NEC CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN 
 * NO EVENT SHALL NEC CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
 * OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 
 * PERFORMANCE OF THIS SOFTWARE. 
 */

/*
 */

#ifndef _WIDEDEF_H_
#define _WIDEDEF_H_

#ifdef __FreeBSD__
# include <osreldate.h>
#endif

#if (defined(__FreeBSD__) && __FreeBSD_version < 500000) \
    || defined(__NetBSD__) || defined(__OpenBSD__)
# include <machine/ansi.h>
#endif

#if (defined(__FreeBSD__) && __FreeBSD_version < 500000) \
    || defined(__NetBSD__) || defined(__OpenBSD__)
# ifdef _BSD_WCHAR_T_
#  undef _BSD_WCHAR_T_
#  ifdef WCHAR16
#   define _BSD_WCHAR_T_ unsigned short
#  else
#   define _BSD_WCHAR_T_ unsigned long
#  endif
#  include <stddef.h>
#  define _WCHAR_T
# endif
#elif defined(__FreeBSD__) && __FreeBSD_version >= 500000
# ifdef WCHAR16
typedef unsigned short wchar_t;
#  define _WCHAR_T_DECLARED
# endif
# include <stddef.h>
# define _WCHAR_T
#elif defined(__APPLE__)
# ifdef WCHAR16
typedef unsigned short wchar_t;
# else
typedef unsigned long wchar_t;
# endif
# define _BSD_WCHAR_T_DEFINED_ /* <= 10.3 */
# define _WCHAR_T /* >= 10.4 */
#else
#if !defined(WCHAR_T) && !defined(_WCHAR_T) && !defined(_WCHAR_T_) \
 && !defined(__WCHAR_T) && !defined(_GCC_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
# ifdef WCHAR16
typedef unsigned short wchar_t;
# else
/* replace this with #include or typedef appropriate for your system */
typedef unsigned long wchar_t;
# endif
# define WCHAR_T
# define _WCHAR_T
# define _WCHAR_T_
# define __WCHAR_T
# define _GCC_WCHAR_T
#define _WCHAR_T_DEFINED
#endif
#endif

#endif /* _WIDEDEF_H_ */
