2000-02-03 19:54:49 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-02-03 19:54:49 +00:00
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
* Copyright (C) 1999-2001, International Business Machines
|
2000-02-03 19:54:49 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
2000-02-03 19:54:49 +00:00
|
|
|
* file name: umachine.h
|
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 1999sep13
|
|
|
|
* created by: Markus W. Scherer
|
|
|
|
*
|
|
|
|
* This file defines basic types and constants for utf.h to be
|
|
|
|
* platform-independent. umachine.h and utf.h are included into
|
|
|
|
* utypes.h to provide all the general definitions for ICU.
|
|
|
|
* All of these definitions used to be in utypes.h before
|
|
|
|
* the UTF-handling macros made this unmaintainable.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UMACHINE_H__
|
|
|
|
#define __UMACHINE_H__
|
|
|
|
|
2000-12-08 18:43:57 +00:00
|
|
|
/**
|
|
|
|
* \file
|
2000-12-15 03:58:31 +00:00
|
|
|
* \brief Basic types and constants for UTF
|
2000-12-08 18:43:57 +00:00
|
|
|
*
|
|
|
|
* <h2> Basic types and constants for UTF </h2>
|
|
|
|
* This file defines basic types and constants for utf.h to be
|
|
|
|
* platform-independent. umachine.h and utf.h are included into
|
|
|
|
* utypes.h to provide all the general definitions for ICU.
|
|
|
|
* All of these definitions used to be in utypes.h before
|
|
|
|
* the UTF-handling macros made this unmaintainable.
|
|
|
|
*
|
|
|
|
*/
|
2001-03-21 20:44:20 +00:00
|
|
|
/*==========================================================================*/
|
|
|
|
/* Include platform-dependent definitions */
|
|
|
|
/* which are contained in the platform-specific file platform.h */
|
|
|
|
/*==========================================================================*/
|
2000-02-03 19:54:49 +00:00
|
|
|
|
|
|
|
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
|
|
|
|
# include "unicode/pwin32.h"
|
|
|
|
#elif defined(__OS2__)
|
|
|
|
# include "unicode/pos2.h"
|
|
|
|
#elif defined(__OS400__)
|
|
|
|
# include "unicode/pos400.h"
|
2000-08-28 20:28:21 +00:00
|
|
|
#elif defined(__MWERKS__)
|
|
|
|
# include "unicode/pmacos.h"
|
2000-02-03 19:54:49 +00:00
|
|
|
#else
|
|
|
|
# include "unicode/platform.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when */
|
|
|
|
/* using C++. It should not be defined when compiling under C. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
# ifndef XP_CPLUSPLUS
|
|
|
|
# define XP_CPLUSPLUS
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# undef XP_CPLUSPLUS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* For C wrappers, we use the symbol U_CAPI. */
|
|
|
|
/* This works properly if the includer is C or C++. */
|
|
|
|
/* Functions are declared U_CAPI return-type U_EXPORT2 function-name() ... */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
#ifdef XP_CPLUSPLUS
|
|
|
|
# define U_CFUNC extern "C"
|
|
|
|
# define U_CDECL_BEGIN extern "C" {
|
|
|
|
# define U_CDECL_END }
|
|
|
|
#else
|
2000-07-12 06:34:43 +00:00
|
|
|
# define U_CFUNC extern
|
2000-02-03 19:54:49 +00:00
|
|
|
# define U_CDECL_BEGIN
|
|
|
|
# define U_CDECL_END
|
|
|
|
#endif
|
|
|
|
#define U_CAPI U_CFUNC U_EXPORT
|
|
|
|
|
2000-03-30 01:12:01 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* limits for int32_t etc., like in POSIX inttypes.h */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef INT8_MIN
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT8_MIN ((int8_t)(-128))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef INT16_MIN
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT16_MIN ((int16_t)(-32767-1))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef INT32_MIN
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT32_MIN ((int32_t)(-2147483647-1))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef INT8_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT8_MAX ((int8_t)(127))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef INT16_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT16_MAX ((int16_t)(32767))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef INT32_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT32_MAX ((int32_t)(2147483647))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef UINT8_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define UINT8_MAX ((uint8_t)(255U))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef UINT16_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define UINT16_MAX ((uint16_t)(65535U))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef UINT32_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define UINT32_MAX ((uint32_t)(4294967295U))
|
2000-03-30 01:12:01 +00:00
|
|
|
#endif
|
|
|
|
|
2000-03-30 21:30:21 +00:00
|
|
|
#if defined(__64BIT__) || defined(_LONG_LONG) || defined(_LP64) || defined(WIN64) || defined(_WIN64)
|
|
|
|
# ifndef INT64_MIN
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT64_MIN ((int64_t)(-9223372036854775807-1))
|
2000-03-30 21:30:21 +00:00
|
|
|
# endif
|
|
|
|
# ifndef INT64_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define INT64_MAX ((int64_t)(9223372036854775807))
|
2000-03-30 21:30:21 +00:00
|
|
|
# endif
|
|
|
|
# ifndef UINT64_MAX
|
2000-08-30 23:25:59 +00:00
|
|
|
# define UINT64_MAX ((uint64_t)(18446744073709551615))
|
2000-03-30 21:30:21 +00:00
|
|
|
# endif
|
|
|
|
# ifndef INTMAX_MIN
|
|
|
|
# define INTMAX_MIN INT64_MIN
|
|
|
|
# endif
|
|
|
|
# ifndef INTMAX_MAX
|
|
|
|
# define INTMAX_MAX INT64_MAX
|
|
|
|
# endif
|
|
|
|
# ifndef UINTMAX_MAX
|
|
|
|
# define UINTMAX_MAX UINT64_MAX
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# ifndef INTMAX_MIN
|
|
|
|
# define INTMAX_MIN INT32_MIN
|
|
|
|
# endif
|
|
|
|
# ifndef INTMAX_MAX
|
|
|
|
# define INTMAX_MAX INT32_MAX
|
|
|
|
# endif
|
|
|
|
# ifndef UINTMAX_MAX
|
|
|
|
# define UINTMAX_MAX UINT32_MAX
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2000-02-03 19:54:49 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
/* Boolean data type */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
#if !HAVE_BOOL_T
|
|
|
|
typedef int8_t bool_t;
|
|
|
|
#endif
|
|
|
|
|
2000-05-18 22:08:39 +00:00
|
|
|
typedef int8_t UBool;
|
|
|
|
|
2000-02-03 19:54:49 +00:00
|
|
|
#ifndef TRUE
|
|
|
|
# define TRUE 1
|
|
|
|
#endif
|
|
|
|
#ifndef FALSE
|
|
|
|
# define FALSE 0
|
|
|
|
#endif
|
|
|
|
|
2001-05-08 17:02:18 +00:00
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* U_INLINE and U_ALIGN_CODE Set default vaues if these are not already */
|
|
|
|
/* defined. Definitions normally are in */
|
|
|
|
/* platform.h or the corresponding file for */
|
|
|
|
/* the OS in use. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
#ifndef U_ALIGN_CODE
|
|
|
|
# define U_ALIGN_CODE(n)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef U_INLINE
|
|
|
|
# define U_INLINE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-02-03 19:54:49 +00:00
|
|
|
#endif
|