25 #ifndef __UMACHINE_H__
26 #define __UMACHINE_H__
80 # define U_CFUNC extern "C"
81 # define U_CDECL_BEGIN extern "C" {
82 # define U_CDECL_END }
84 # define U_CFUNC extern
85 # define U_CDECL_BEGIN
89 #ifndef U_ATTRIBUTE_DEPRECATED
95 #if U_GCC_MAJOR_MINOR >= 302
96 # define U_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
102 #elif defined(_MSC_VER) && (_MSC_VER >= 1400)
103 # define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
105 # define U_ATTRIBUTE_DEPRECATED
110 #define U_CAPI U_CFUNC U_EXPORT
112 #define U_STABLE U_CAPI
114 #define U_DRAFT U_CAPI
116 #define U_DEPRECATED U_CAPI U_ATTRIBUTE_DEPRECATED
118 #define U_OBSOLETE U_CAPI
120 #define U_INTERNAL U_CAPI
130 #define U_OVERRIDE override
140 #if !defined(U_FINAL) || defined(U_IN_DOXYGEN)
141 #define U_FINAL final
168 #ifndef UPRV_BLOCK_MACRO_BEGIN
169 #define UPRV_BLOCK_MACRO_BEGIN do
177 #ifndef UPRV_BLOCK_MACRO_END
178 #define UPRV_BLOCK_MACRO_END while (false)
187 # define INT8_MIN ((int8_t)(-128))
191 # define INT16_MIN ((int16_t)(-32767-1))
195 # define INT32_MIN ((int32_t)(-2147483647-1))
200 # define INT8_MAX ((int8_t)(127))
204 # define INT16_MAX ((int16_t)(32767))
208 # define INT32_MAX ((int32_t)(2147483647))
213 # define UINT8_MAX ((uint8_t)(255U))
217 # define UINT16_MAX ((uint16_t)(65535U))
221 # define UINT32_MAX ((uint32_t)(4294967295U))
224 #if defined(U_INT64_T_UNAVAILABLE)
225 # error int64_t is required for decimal format and rule-based number format.
233 # define INT64_C(c) c ## LL
241 # define UINT64_C(c) c ## ULL
245 # define U_INT64_MIN ((int64_t)(INT64_C(-9223372036854775807)-1))
249 # define U_INT64_MAX ((int64_t)(INT64_C(9223372036854775807)))
251 # ifndef U_UINT64_MAX
253 # define U_UINT64_MAX ((uint64_t)(UINT64_C(18446744073709551615)))
283 #ifdef U_DEFINE_FALSE_AND_TRUE
285 #elif defined(U_COMBINED_IMPLEMENTATION) || \
286 defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
287 defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
288 defined(U_TOOLUTIL_IMPLEMENTATION)
290 # define U_DEFINE_FALSE_AND_TRUE 1
293 # define U_DEFINE_FALSE_AND_TRUE 0
296 #if U_DEFINE_FALSE_AND_TRUE || defined(U_IN_DOXYGEN)
333 #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
334 # ifdef __STDC_ISO_10646__
335 # if (U_SIZEOF_WCHAR_T==2)
336 # define U_WCHAR_IS_UTF16
337 # elif (U_SIZEOF_WCHAR_T==4)
338 # define U_WCHAR_IS_UTF32
340 # elif defined __UCS2__
341 # if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2)
342 # define U_WCHAR_IS_UTF16
344 # elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__))
345 # if (U_SIZEOF_WCHAR_T==4)
346 # define U_WCHAR_IS_UTF32
348 # elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED)
349 # define U_WCHAR_IS_UTF32
350 # elif U_PLATFORM_HAS_WIN32_API
351 # define U_WCHAR_IS_UTF16
358 #define U_SIZEOF_UCHAR 2
365 #if (U_PLATFORM == U_PF_AIX) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11)
368 # define U_CHAR16_IS_TYPEDEF 1
369 #elif defined(_MSC_VER) && (_MSC_VER < 1900)
372 # define U_CHAR16_IS_TYPEDEF 1
374 # define U_CHAR16_IS_TYPEDEF 0
407 #elif !defined(UCHAR_TYPE)
408 # define UCHAR_TYPE uint16_t
411 #if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \
412 defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
414 typedef char16_t
UChar;
415 #elif defined(UCHAR_TYPE)
416 typedef UCHAR_TYPE
UChar;
417 #elif (U_CPLUSPLUS_VERSION >= 11)
420 typedef uint16_t
UChar;
442 #if U_SIZEOF_WCHAR_T==2
444 #elif defined(__CHAR16_TYPE__)
487 #define U_SENTINEL (-1)
489 #include "unicode/urename.h"
C API: Definitions of integer types of various widths.
C API: Unicode Properties.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
int8_t UBool
The ICU boolean type, a signed-byte integer.
char16_t UChar
The base type for UTF-16 code units and pointers.
uint16_t OldUChar
Default ICU 58 definition of UChar.