00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __UMACHINE_H__
00024 #define __UMACHINE_H__
00025
00026
00039
00040
00041
00042
00043
00044 #if defined(U_PALMOS)
00045 # include "unicode/ppalmos.h"
00046 #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
00047 # include "unicode/pwin32.h"
00048 #else
00049 # include "unicode/platform.h"
00050 #endif
00051
00052
00053
00054
00055
00056 #include <stddef.h>
00057
00058
00059
00060
00061
00062
00063 #ifdef __cplusplus
00064 # ifndef XP_CPLUSPLUS
00065 # define XP_CPLUSPLUS
00066 # endif
00067 #else
00068 # undef XP_CPLUSPLUS
00069 #endif
00070
00071
00072
00073
00074
00075
00076
00095 #ifdef XP_CPLUSPLUS
00096 # define U_CFUNC extern "C"
00097 # define U_CDECL_BEGIN extern "C" {
00098 # define U_CDECL_END }
00099 #else
00100 # define U_CFUNC extern
00101 # define U_CDECL_BEGIN
00102 # define U_CDECL_END
00103 #endif
00104
00106 #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
00107 # define U_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
00108
00109 #elif defined(U_WINDOWS) && defined(_MSC_VER) && (_MSC_VER >= 1400)
00110 # define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
00111 #else
00112 # define U_ATTRIBUTE_DEPRECATED
00113 #endif
00114
00115 #define U_CAPI U_CFUNC U_EXPORT
00116 #define U_STABLE U_CAPI
00117 #define U_DRAFT U_CAPI
00118 #define U_DEPRECATED U_CAPI U_ATTRIBUTE_DEPRECATED
00119 #define U_OBSOLETE U_CAPI
00120 #define U_INTERNAL U_CAPI
00121
00122
00123
00124
00125
00126 #ifndef INT8_MIN
00127
00128 # define INT8_MIN ((int8_t)(-128))
00129 #endif
00130 #ifndef INT16_MIN
00131
00132 # define INT16_MIN ((int16_t)(-32767-1))
00133 #endif
00134 #ifndef INT32_MIN
00135
00136 # define INT32_MIN ((int32_t)(-2147483647-1))
00137 #endif
00138
00139 #ifndef INT8_MAX
00140
00141 # define INT8_MAX ((int8_t)(127))
00142 #endif
00143 #ifndef INT16_MAX
00144
00145 # define INT16_MAX ((int16_t)(32767))
00146 #endif
00147 #ifndef INT32_MAX
00148
00149 # define INT32_MAX ((int32_t)(2147483647))
00150 #endif
00151
00152 #ifndef UINT8_MAX
00153
00154 # define UINT8_MAX ((uint8_t)(255U))
00155 #endif
00156 #ifndef UINT16_MAX
00157
00158 # define UINT16_MAX ((uint16_t)(65535U))
00159 #endif
00160 #ifndef UINT32_MAX
00161
00162 # define UINT32_MAX ((uint32_t)(4294967295U))
00163 #endif
00164
00165 #if defined(U_INT64_T_UNAVAILABLE)
00166 # error int64_t is required for decimal format and rule-based number format.
00167 #else
00168 # ifndef INT64_C
00169
00174 # define INT64_C(c) c ## LL
00175 # endif
00176 # ifndef UINT64_C
00177
00182 # define UINT64_C(c) c ## ULL
00183 # endif
00184 # ifndef U_INT64_MIN
00185
00186 # define U_INT64_MIN ((int64_t)(INT64_C(-9223372036854775807)-1))
00187 # endif
00188 # ifndef U_INT64_MAX
00189
00190 # define U_INT64_MAX ((int64_t)(INT64_C(9223372036854775807)))
00191 # endif
00192 # ifndef U_UINT64_MAX
00193
00194 # define U_UINT64_MAX ((uint64_t)(UINT64_C(18446744073709551615)))
00195 # endif
00196 #endif
00197
00198
00199
00200
00201
00203 typedef int8_t UBool;
00204
00205 #ifndef TRUE
00206
00207 # define TRUE 1
00208 #endif
00209 #ifndef FALSE
00210
00211 # define FALSE 0
00212 #endif
00213
00214
00215
00216
00217
00218
00219
00220
00227 #ifndef U_HAVE_WCHAR_H
00228 # define U_HAVE_WCHAR_H 1
00229 #endif
00230
00237 #if U_SIZEOF_WCHAR_T==0
00238 # undef U_SIZEOF_WCHAR_T
00239 # define U_SIZEOF_WCHAR_T 4
00240 #endif
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254 #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
00255 # ifdef __STDC_ISO_10646__
00256 # if (U_SIZEOF_WCHAR_T==2)
00257 # define U_WCHAR_IS_UTF16
00258 # elif (U_SIZEOF_WCHAR_T==4)
00259 # define U_WCHAR_IS_UTF32
00260 # endif
00261 # elif defined __UCS2__
00262 # if (__OS390__ || __OS400__) && (U_SIZEOF_WCHAR_T==2)
00263 # define U_WCHAR_IS_UTF16
00264 # endif
00265 # elif defined __UCS4__
00266 # if (U_SIZEOF_WCHAR_T==4)
00267 # define U_WCHAR_IS_UTF32
00268 # endif
00269 # elif defined(U_WINDOWS)
00270 # define U_WCHAR_IS_UTF16
00271 # endif
00272 #endif
00273
00274
00275
00277 #define U_SIZEOF_UCHAR 2
00278
00290
00291 #if U_SIZEOF_WCHAR_T==2
00292 typedef wchar_t UChar;
00293 #else
00294 typedef uint16_t UChar;
00295 #endif
00296
00314 typedef int32_t UChar32;
00315
00316
00317
00318
00319
00320
00321
00322
00323 #ifndef U_HIDE_INTERNAL_API
00324
00331 #ifndef U_ALIGN_CODE
00332 # define U_ALIGN_CODE(n)
00333 #endif
00334
00335 #endif
00336
00337 #ifndef U_INLINE
00338 # ifdef XP_CPLUSPLUS
00339 # define U_INLINE inline
00340 # else
00341 # define U_INLINE
00342 # endif
00343 #endif
00344
00345 #include "unicode/urename.h"
00346
00347 #endif