2
******************************************************************************
4
* Copyright (C) 1999-2001, International Business Machines
5
* Corporation and others. All Rights Reserved.
7
******************************************************************************
8
* file name: umachine.h
10
* tab size: 8 (not used)
13
* created on: 1999sep13
14
* created by: Markus W. Scherer
16
* This file defines basic types and constants for utf.h to be
17
* platform-independent. umachine.h and utf.h are included into
18
* utypes.h to provide all the general definitions for ICU.
19
* All of these definitions used to be in utypes.h before
20
* the UTF-handling macros made this unmaintainable.
23
#ifndef __UMACHINE_H__
24
#define __UMACHINE_H__
29
* \brief Basic types and constants for UTF
31
* <h2> Basic types and constants for UTF </h2>
32
* This file defines basic types and constants for utf.h to be
33
* platform-independent. umachine.h and utf.h are included into
34
* utypes.h to provide all the general definitions for ICU.
35
* All of these definitions used to be in utypes.h before
36
* the UTF-handling macros made this unmaintainable.
39
/*==========================================================================*/
40
/* Include platform-dependent definitions */
41
/* which are contained in the platform-specific file platform.h */
42
/*==========================================================================*/
44
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
45
# include "unicode/pwin32.h"
46
#elif defined(__OS2__)
47
# include "unicode/pos2.h"
48
#elif defined(__OS400__)
49
# include "unicode/pos400.h"
50
#elif defined(__MWERKS__)
51
# include "unicode/pmacos.h"
53
# include "unicode/platform.h"
56
/*===========================================================================*/
57
/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when */
58
/* using C++. It should not be defined when compiling under C. */
59
/*===========================================================================*/
69
/*===========================================================================*/
70
/* For C wrappers, we use the symbol U_CAPI. */
71
/* This works properly if the includer is C or C++. */
72
/* Functions are declared U_CAPI return-type U_EXPORT2 function-name() ... */
73
/*===========================================================================*/
76
# define U_CFUNC extern "C"
77
# define U_CDECL_BEGIN extern "C" {
78
# define U_CDECL_END }
80
# define U_CFUNC extern
81
# define U_CDECL_BEGIN
85
/* Define namespace symbols if the compiler supports it. */
87
# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
88
# define U_NAMESPACE_END }
89
# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
90
# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
92
# define U_NAMESPACE_BEGIN
93
# define U_NAMESPACE_END
94
# define U_NAMESPACE_USE
95
# define U_NAMESPACE_QUALIFIER
97
#define U_CAPI U_CFUNC U_EXPORT
98
/*===========================================================================*/
99
/* limits for int32_t etc., like in POSIX inttypes.h */
100
/*===========================================================================*/
103
# define INT8_MIN ((int8_t)(-128))
106
# define INT16_MIN ((int16_t)(-32767-1))
109
# define INT32_MIN ((int32_t)(-2147483647-1))
113
# define INT8_MAX ((int8_t)(127))
116
# define INT16_MAX ((int16_t)(32767))
119
# define INT32_MAX ((int32_t)(2147483647))
123
# define UINT8_MAX ((uint8_t)(255U))
126
# define UINT16_MAX ((uint16_t)(65535U))
129
# define UINT32_MAX ((uint32_t)(4294967295U))
132
#if defined(__64BIT__) || defined(_LONG_LONG) || defined(_LP64) || defined(WIN64) || defined(_WIN64)
134
# define INT64_MIN ((int64_t)(-9223372036854775807-1))
137
# define INT64_MAX ((int64_t)(9223372036854775807))
140
# define UINT64_MAX ((uint64_t)(18446744073709551615))
143
# define INTMAX_MIN INT64_MIN
146
# define INTMAX_MAX INT64_MAX
149
# define UINTMAX_MAX UINT64_MAX
153
# define INTMAX_MIN INT32_MIN
156
# define INTMAX_MAX INT32_MAX
159
# define UINTMAX_MAX UINT32_MAX
163
/*===========================================================================*/
164
/* Boolean data type */
165
/*===========================================================================*/
167
typedef int8_t UBool;
177
/*===========================================================================*/
178
/* U_INLINE and U_ALIGN_CODE Set default vaues if these are not already */
179
/* defined. Definitions normally are in */
180
/* platform.h or the corresponding file for */
182
/*===========================================================================*/
184
# define U_ALIGN_CODE(n)
191
#include "unicode/urename.h"