91#define U_PF_WINDOWS 1000
93#define U_PF_MINGW 1800
99#define U_PF_CYGWIN 1900
102#define U_PF_HPUX 2100
104#define U_PF_SOLARIS 2600
110#define U_PF_IRIX 3200
119#define U_PF_DARWIN 3500
121#define U_PF_IPHONE 3550
125#define U_PF_LINUX 4000
132#define U_PF_BROWSER_NATIVE_CLIENT 4020
134#define U_PF_ANDROID 4050
136#define U_PF_FUCHSIA 4100
145#define U_PF_EMSCRIPTEN 5010
147#define U_PF_OS390 9000
149#define U_PF_OS400 9400
153#elif defined(__MINGW32__)
154# define U_PLATFORM U_PF_MINGW
155#elif defined(__CYGWIN__)
156# define U_PLATFORM U_PF_CYGWIN
157#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
158# define U_PLATFORM U_PF_WINDOWS
159#elif defined(__ANDROID__)
160# define U_PLATFORM U_PF_ANDROID
162# include <android/api-level.h>
163#elif defined(__pnacl__) || defined(__native_client__)
164# define U_PLATFORM U_PF_BROWSER_NATIVE_CLIENT
165#elif defined(__Fuchsia__)
166# define U_PLATFORM U_PF_FUCHSIA
167#elif defined(linux) || defined(__linux__) || defined(__linux)
168# define U_PLATFORM U_PF_LINUX
169#elif defined(__APPLE__) && defined(__MACH__)
170# include <TargetConditionals.h>
171# if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && (defined(TARGET_OS_MACCATALYST) && !TARGET_OS_MACCATALYST)
172# define U_PLATFORM U_PF_IPHONE
174# define U_PLATFORM U_PF_DARWIN
176#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__MirBSD__)
177# if defined(__FreeBSD__)
178# include <sys/endian.h>
180# define U_PLATFORM U_PF_BSD
181#elif defined(sun) || defined(__sun)
183# define U_PLATFORM U_PF_SOLARIS
184# if defined(__GNUC__)
189# include <sys/isa_defs.h>
191#elif defined(_AIX) || defined(__TOS_AIX__)
192# define U_PLATFORM U_PF_AIX
193#elif defined(_hpux) || defined(hpux) || defined(__hpux)
194# define U_PLATFORM U_PF_HPUX
195#elif defined(sgi) || defined(__sgi)
196# define U_PLATFORM U_PF_IRIX
197#elif defined(__QNX__) || defined(__QNXNTO__)
198# define U_PLATFORM U_PF_QNX
199#elif defined(__TOS_MVS__)
200# define U_PLATFORM U_PF_OS390
201#elif defined(__OS400__) || defined(__TOS_OS400__)
202# define U_PLATFORM U_PF_OS400
203#elif defined(__EMSCRIPTEN__)
204# define U_PLATFORM U_PF_EMSCRIPTEN
206# define U_PLATFORM U_PF_UNKNOWN
216#if (defined(_MSC_VER) && !(defined(__clang__) && __clang__)) || defined(U_IN_DOXYGEN)
241#ifdef U_PLATFORM_USES_ONLY_WIN32_API
243#elif (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_MINGW) || defined(CYGWINMSVC)
244# define U_PLATFORM_USES_ONLY_WIN32_API 1
247# define U_PLATFORM_USES_ONLY_WIN32_API 0
256#ifdef U_PLATFORM_HAS_WIN32_API
258#elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
259# define U_PLATFORM_HAS_WIN32_API 1
261# define U_PLATFORM_HAS_WIN32_API 0
270#ifdef U_PLATFORM_HAS_WINUWP_API
273# define U_PLATFORM_HAS_WINUWP_API 0
282#ifdef U_PLATFORM_IMPLEMENTS_POSIX
284#elif U_PLATFORM_USES_ONLY_WIN32_API
285# define U_PLATFORM_IMPLEMENTS_POSIX 0
287# define U_PLATFORM_IMPLEMENTS_POSIX 1
295#ifdef U_PLATFORM_IS_LINUX_BASED
297#elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= 4499
298# define U_PLATFORM_IS_LINUX_BASED 1
300# define U_PLATFORM_IS_LINUX_BASED 0
308#ifdef U_PLATFORM_IS_DARWIN_BASED
310#elif U_PF_DARWIN <= U_PLATFORM && U_PLATFORM <= U_PF_IPHONE
311# define U_PLATFORM_IS_DARWIN_BASED 1
313# define U_PLATFORM_IS_DARWIN_BASED 0
331# define U_GCC_MAJOR_MINOR (__GNUC__ * 100 + __GNUC_MINOR__)
333# define U_GCC_MAJOR_MINOR 0
341#ifdef U_IS_BIG_ENDIAN
343#elif defined(BYTE_ORDER) && defined(BIG_ENDIAN)
344# define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
345#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
347# define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
348#elif defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
349# define U_IS_BIG_ENDIAN 1
350#elif defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN)
351# define U_IS_BIG_ENDIAN 0
352#elif U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_OS400 || defined(__s390__) || defined(__s390x__)
354# define U_IS_BIG_ENDIAN 1
355#elif defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0)
357# define U_IS_BIG_ENDIAN 1
358#elif defined(sparc) || defined(__sparc) || defined(__sparc__)
360# define U_IS_BIG_ENDIAN 1
362# define U_IS_BIG_ENDIAN 0
370#ifdef U_HAVE_PLACEMENT_NEW
372#elif defined(__BORLANDC__)
373# define U_HAVE_PLACEMENT_NEW 0
375# define U_HAVE_PLACEMENT_NEW 1
384#ifdef U_HAVE_DEBUG_LOCATION_NEW
386#elif defined(_MSC_VER)
387# define U_HAVE_DEBUG_LOCATION_NEW 1
389# define U_HAVE_DEBUG_LOCATION_NEW 0
393#ifdef __has_attribute
394# define UPRV_HAS_ATTRIBUTE(x) __has_attribute(x)
396# define UPRV_HAS_ATTRIBUTE(x) 0
398#ifdef __has_cpp_attribute
399# define UPRV_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
401# define UPRV_HAS_CPP_ATTRIBUTE(x) 0
403#ifdef __has_declspec_attribute
404# define UPRV_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)
406# define UPRV_HAS_DECLSPEC_ATTRIBUTE(x) 0
409# define UPRV_HAS_BUILTIN(x) __has_builtin(x)
411# define UPRV_HAS_BUILTIN(x) 0
414# define UPRV_HAS_FEATURE(x) __has_feature(x)
416# define UPRV_HAS_FEATURE(x) 0
418#ifdef __has_extension
419# define UPRV_HAS_EXTENSION(x) __has_extension(x)
421# define UPRV_HAS_EXTENSION(x) 0
424# define UPRV_HAS_WARNING(x) __has_warning(x)
426# define UPRV_HAS_WARNING(x) 0
430#if defined(__clang__)
431#define UPRV_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
433#define UPRV_NO_SANITIZE_UNDEFINED
441#if defined(__GNUC__) && __GNUC__>=3
442# define U_MALLOC_ATTR __attribute__ ((__malloc__))
444# define U_MALLOC_ATTR
452#if (defined(__GNUC__) && \
453 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
454 UPRV_HAS_ATTRIBUTE(alloc_size)
455# define U_ALLOC_SIZE_ATTR(X) __attribute__ ((alloc_size(X)))
456# define U_ALLOC_SIZE_ATTR2(X,Y) __attribute__ ((alloc_size(X,Y)))
458# define U_ALLOC_SIZE_ATTR(X)
459# define U_ALLOC_SIZE_ATTR2(X,Y)
468#ifdef U_CPLUSPLUS_VERSION
469# if U_CPLUSPLUS_VERSION != 0 && !defined(__cplusplus)
470# undef U_CPLUSPLUS_VERSION
471# define U_CPLUSPLUS_VERSION 0
474#elif !defined(__cplusplus)
475# define U_CPLUSPLUS_VERSION 0
476#elif __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
477# define U_CPLUSPLUS_VERSION 17
478#elif __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
479# define U_CPLUSPLUS_VERSION 14
480#elif __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
481# define U_CPLUSPLUS_VERSION 11
484# define U_CPLUSPLUS_VERSION 1
495#elif defined(U_FALLTHROUGH)
497#elif defined(__clang__)
500# if UPRV_HAS_CPP_ATTRIBUTE(clang::fallthrough) || \
501 (UPRV_HAS_FEATURE(cxx_attributes) && \
502 UPRV_HAS_WARNING("-Wimplicit-fallthrough"))
503# define U_FALLTHROUGH [[clang::fallthrough]]
505#elif defined(__GNUC__) && (__GNUC__ >= 7)
506# define U_FALLTHROUGH __attribute__((fallthrough))
510# define U_FALLTHROUGH
523#define U_ASCII_FAMILY 0
529#define U_EBCDIC_FAMILY 1
573#ifdef U_CHARSET_FAMILY
575#elif U_PLATFORM == U_PF_OS390 && (!defined(__CHARSET_LIB) || !__CHARSET_LIB)
576# define U_CHARSET_FAMILY U_EBCDIC_FAMILY
577#elif U_PLATFORM == U_PF_OS400 && !defined(__UTF32__)
578# define U_CHARSET_FAMILY U_EBCDIC_FAMILY
580# define U_CHARSET_FAMILY U_ASCII_FAMILY
603#ifdef U_CHARSET_IS_UTF8
605#elif U_PLATFORM_IS_LINUX_BASED || U_PLATFORM_IS_DARWIN_BASED || \
606 U_PLATFORM == U_PF_EMSCRIPTEN
607# define U_CHARSET_IS_UTF8 1
609# define U_CHARSET_IS_UTF8 0
626#elif U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9
632# define U_HAVE_WCHAR_H 0
634# define U_HAVE_WCHAR_H 1
643#ifdef U_SIZEOF_WCHAR_T
645#elif (U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9)
650# define U_SIZEOF_WCHAR_T 1
651#elif U_PLATFORM_HAS_WIN32_API || U_PLATFORM == U_PF_CYGWIN
652# define U_SIZEOF_WCHAR_T 2
653#elif U_PLATFORM == U_PF_AIX
663# define U_SIZEOF_WCHAR_T 4
665# define U_SIZEOF_WCHAR_T 2
667#elif U_PLATFORM == U_PF_OS390
674# define U_SIZEOF_WCHAR_T 4
676# define U_SIZEOF_WCHAR_T 2
678#elif U_PLATFORM == U_PF_OS400
679# if defined(__UTF32__)
685# define U_SIZEOF_WCHAR_T 4
686# elif defined(__UCS2__)
692# define U_SIZEOF_WCHAR_T 2
699# define U_SIZEOF_WCHAR_T 2
702# define U_SIZEOF_WCHAR_T 4
706#define U_HAVE_WCSCPY U_HAVE_WCHAR_H
719#ifdef U_HAVE_CHAR16_T
727# if defined(__cplusplus) || !U_PLATFORM_IS_DARWIN_BASED
728# define U_HAVE_CHAR16_T 1
730# define U_HAVE_CHAR16_T 0
741#ifdef U_DECLARE_UTF16
743#elif U_HAVE_CHAR16_T \
744 || (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
745 || (defined(__HP_aCC) && __HP_aCC >= 035000) \
746 || (defined(__HP_cc) && __HP_cc >= 111106) \
747 || (defined(U_IN_DOXYGEN))
748# define U_DECLARE_UTF16(string) u ## string
749#elif U_SIZEOF_WCHAR_T == 2 \
750 && (U_CHARSET_FAMILY == 0 || (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400 && defined(__UCS2__)))
751# define U_DECLARE_UTF16(string) L ## string
764#elif defined(U_STATIC_IMPLEMENTATION)
766#elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
767 UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
768# define U_EXPORT __declspec(dllexport)
769#elif defined(__GNUC__)
770# define U_EXPORT __attribute__((visibility("default")))
771#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
772 || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
773# define U_EXPORT __global
783#elif defined(_MSC_VER)
784# define U_EXPORT2 __cdecl
791#elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
792 UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
794# define U_IMPORT __declspec(dllimport)
808#elif defined(__GNUC__)
809# define U_HIDDEN __attribute__((visibility("hidden")))
831#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
832# define U_CALLCONV __cdecl
834# define U_CALLCONV U_EXPORT2
842#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
843# define U_CALLCONV_FPTR U_CALLCONV
845# define U_CALLCONV_FPTR
User-configurable settings.
C API: definitions of ICU version numbers.