2004-12-18 09:16:31 +00:00
|
|
|
/*
|
2005-02-13 16:15:31 +00:00
|
|
|
* $Id: types.h,v 1.13 2005-02-13 16:15:31 bacon Exp $
|
2004-12-18 09:16:31 +00:00
|
|
|
*/
|
|
|
|
|
2004-12-18 09:58:49 +00:00
|
|
|
#ifndef _XP_TYPES_H_
|
|
|
|
#define _XP_TYPES_H_
|
2004-12-18 09:16:31 +00:00
|
|
|
|
2005-01-19 11:58:26 +00:00
|
|
|
#ifndef _WIN32
|
|
|
|
#include <xp/config.h>
|
|
|
|
#endif
|
2005-02-06 03:27:54 +00:00
|
|
|
#include <xp/xp_types.h>
|
2004-12-18 09:16:31 +00:00
|
|
|
|
2005-02-13 16:15:31 +00:00
|
|
|
#if defined(XP_HAVE_LONG_LONG)
|
|
|
|
typedef long long xp_long_t;
|
|
|
|
typedef unsigned long long xp_ulong_t;
|
|
|
|
#elif defined(XP_HAVE___INT64)
|
|
|
|
typedef __int64 xp_long_t;
|
|
|
|
typedef unsigned __int64 xp_ulong_t;
|
|
|
|
#else
|
|
|
|
typedef long xp_long_t;
|
|
|
|
typedef unsigned long xp_ulong_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
|
|
|
|
typedef long long xp_int_t;
|
|
|
|
typedef unsigned long long xp_uint_t;
|
|
|
|
#elif SIZEOF_VOID_P == SIZEOF_LONG
|
|
|
|
typedef long xp_int_t;
|
|
|
|
typedef unsigned long xp_uint_t;
|
|
|
|
#else
|
|
|
|
typedef int xp_int_t;
|
|
|
|
typedef unsigned int xp_uint_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_CHAR == 8
|
|
|
|
typedef char xp_int8_t;
|
|
|
|
typedef unsigned char xp_uint8_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_SHORT == 16
|
|
|
|
typedef short xp_int16_t;
|
|
|
|
typedef unsigned short xp_uint16_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_INT == 32
|
|
|
|
typedef int xp_int32_t;
|
|
|
|
typedef unsigned int xp_uint32_t;
|
|
|
|
#elif SIZEOF_LONG == 32
|
|
|
|
typedef long xp_int32_t;
|
|
|
|
typedef unsigned long xp_uint32_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_INT = 64
|
|
|
|
typedef int xp_int64_t;
|
|
|
|
typedef unsigned int xp_uint64_t;
|
|
|
|
#elif SIZEOF_LONG == 64
|
|
|
|
typedef long xp_int64_t;
|
|
|
|
typedef unsigned long xp_uint64_t;
|
|
|
|
#elif SIZEOF_LONG_LONG == 64
|
|
|
|
typedef long long xp_int64_t;
|
|
|
|
typedef unsigned long long xp_uint64_t;
|
|
|
|
#endif
|
|
|
|
|
2004-12-18 10:56:00 +00:00
|
|
|
typedef xp_uint8_t xp_byte_t;
|
|
|
|
|
2005-01-19 12:13:48 +00:00
|
|
|
typedef int xp_bool_t;
|
2005-01-19 12:12:42 +00:00
|
|
|
#define xp_true (0 == 0)
|
|
|
|
#define xp_false (0 != 0)
|
|
|
|
|
2005-01-08 13:40:14 +00:00
|
|
|
#ifdef XP_HAVE_WCHAR_T
|
|
|
|
// TODO: make it configurable from outside
|
2005-01-06 15:13:26 +00:00
|
|
|
/*
|
2005-01-02 15:43:46 +00:00
|
|
|
#define XP_CHAR_IS_MCHAR
|
2004-12-18 09:58:49 +00:00
|
|
|
typedef xp_mchar_t xp_char_t;
|
|
|
|
typedef xp_mcint_t xp_cint_t;
|
2005-01-06 15:13:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define XP_CHAR_IS_WCHAR
|
|
|
|
typedef xp_wchar_t xp_char_t;
|
|
|
|
typedef xp_wcint_t xp_cint_t;
|
2004-12-18 09:16:31 +00:00
|
|
|
|
2005-01-08 13:40:14 +00:00
|
|
|
#else
|
|
|
|
#define XP_CHAR_IS_MCHAR
|
|
|
|
typedef xp_mchar_t xp_char_t;
|
|
|
|
typedef xp_mcint_t xp_cint_t;
|
|
|
|
#endif
|
|
|
|
|
2004-12-18 09:16:31 +00:00
|
|
|
#endif
|