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_HAIKU 4080
138#define U_PF_FUCHSIA 4100
147#define U_PF_EMSCRIPTEN 5010
149#define U_PF_OS390 9000
151#define U_PF_OS400 9400
155#elif defined(__MINGW32__)
156# define U_PLATFORM U_PF_MINGW
157#elif defined(__CYGWIN__)
158# define U_PLATFORM U_PF_CYGWIN
160# include <cygwin/version.h>
161#elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
162# define U_PLATFORM U_PF_WINDOWS
163#elif defined(__ANDROID__)
164# define U_PLATFORM U_PF_ANDROID
166# include <android/api-level.h>
167#elif defined(__pnacl__) || defined(__native_client__)
168# define U_PLATFORM U_PF_BROWSER_NATIVE_CLIENT
169#elif defined(__Fuchsia__)
170# define U_PLATFORM U_PF_FUCHSIA
171#elif defined(linux) || defined(__linux__) || defined(__linux)
172# define U_PLATFORM U_PF_LINUX
173#elif defined(__APPLE__) && defined(__MACH__)
174# include <TargetConditionals.h>
175# if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && (defined(TARGET_OS_MACCATALYST) && !TARGET_OS_MACCATALYST)
176# define U_PLATFORM U_PF_IPHONE
178# define U_PLATFORM U_PF_DARWIN
180#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__MirBSD__)
181# if defined(__FreeBSD__)
182# include <sys/endian.h>
184# define U_PLATFORM U_PF_BSD
185#elif defined(sun) || defined(__sun)
187# define U_PLATFORM U_PF_SOLARIS
188# if defined(__GNUC__)
193# include <sys/isa_defs.h>
195#elif defined(_AIX) || defined(__TOS_AIX__)
196# define U_PLATFORM U_PF_AIX
197#elif defined(_hpux) || defined(hpux) || defined(__hpux)
198# define U_PLATFORM U_PF_HPUX
199#elif defined(sgi) || defined(__sgi)
200# define U_PLATFORM U_PF_IRIX
201#elif defined(__QNX__) || defined(__QNXNTO__)
202# define U_PLATFORM U_PF_QNX
203#elif defined(__TOS_MVS__)
204# define U_PLATFORM U_PF_OS390
205#elif defined(__OS400__) || defined(__TOS_OS400__)
206# define U_PLATFORM U_PF_OS400
207#elif defined(__HAIKU__)
208# define U_PLATFORM U_PF_HAIKU
209#elif defined(__EMSCRIPTEN__)
210# define U_PLATFORM U_PF_EMSCRIPTEN
212# define U_PLATFORM U_PF_UNKNOWN
222#if (defined(_MSC_VER) && !(defined(__clang__) && __clang__)) || defined(U_IN_DOXYGEN)
247#ifdef U_PLATFORM_USES_ONLY_WIN32_API
249#elif (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_MINGW) || defined(CYGWINMSVC)
250# define U_PLATFORM_USES_ONLY_WIN32_API 1
253# define U_PLATFORM_USES_ONLY_WIN32_API 0
262#ifdef U_PLATFORM_HAS_WIN32_API
264#elif U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
265# define U_PLATFORM_HAS_WIN32_API 1
267# define U_PLATFORM_HAS_WIN32_API 0
276#ifdef U_PLATFORM_HAS_WINUWP_API
279# define U_PLATFORM_HAS_WINUWP_API 0
288#ifdef U_PLATFORM_IMPLEMENTS_POSIX
290#elif U_PLATFORM_USES_ONLY_WIN32_API
291# define U_PLATFORM_IMPLEMENTS_POSIX 0
293# define U_PLATFORM_IMPLEMENTS_POSIX 1
301#ifdef U_PLATFORM_IS_LINUX_BASED
303#elif U_PF_LINUX <= U_PLATFORM && U_PLATFORM <= 4499
304# define U_PLATFORM_IS_LINUX_BASED 1
306# define U_PLATFORM_IS_LINUX_BASED 0
314#ifdef U_PLATFORM_IS_DARWIN_BASED
316#elif U_PF_DARWIN <= U_PLATFORM && U_PLATFORM <= U_PF_IPHONE
317# define U_PLATFORM_IS_DARWIN_BASED 1
319# define U_PLATFORM_IS_DARWIN_BASED 0
337# define U_GCC_MAJOR_MINOR (__GNUC__ * 100 + __GNUC_MINOR__)
339# define U_GCC_MAJOR_MINOR 0
347#ifdef U_IS_BIG_ENDIAN
349#elif defined(BYTE_ORDER) && defined(BIG_ENDIAN)
350# define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
351#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
353# define U_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
354#elif defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
355# define U_IS_BIG_ENDIAN 1
356#elif defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN)
357# define U_IS_BIG_ENDIAN 0
358#elif U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_OS400 || defined(__s390__) || defined(__s390x__)
360# define U_IS_BIG_ENDIAN 1
361#elif defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0)
363# define U_IS_BIG_ENDIAN 1
364#elif defined(sparc) || defined(__sparc) || defined(__sparc__)
366# define U_IS_BIG_ENDIAN 1
368# define U_IS_BIG_ENDIAN 0
376#ifdef U_HAVE_PLACEMENT_NEW
378#elif defined(__BORLANDC__)
379# define U_HAVE_PLACEMENT_NEW 0
381# define U_HAVE_PLACEMENT_NEW 1
390#ifdef U_HAVE_DEBUG_LOCATION_NEW
392#elif defined(_MSC_VER)
393# define U_HAVE_DEBUG_LOCATION_NEW 1
395# define U_HAVE_DEBUG_LOCATION_NEW 0
399#ifdef __has_attribute
400# define UPRV_HAS_ATTRIBUTE(x) __has_attribute(x)
402# define UPRV_HAS_ATTRIBUTE(x) 0
404#ifdef __has_cpp_attribute
405# define UPRV_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
407# define UPRV_HAS_CPP_ATTRIBUTE(x) 0
409#ifdef __has_declspec_attribute
410# define UPRV_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)
412# define UPRV_HAS_DECLSPEC_ATTRIBUTE(x) 0
415# define UPRV_HAS_BUILTIN(x) __has_builtin(x)
417# define UPRV_HAS_BUILTIN(x) 0
420# define UPRV_HAS_FEATURE(x) __has_feature(x)
422# define UPRV_HAS_FEATURE(x) 0
424#ifdef __has_extension
425# define UPRV_HAS_EXTENSION(x) __has_extension(x)
427# define UPRV_HAS_EXTENSION(x) 0
430# define UPRV_HAS_WARNING(x) __has_warning(x)
432# define UPRV_HAS_WARNING(x) 0
436#if defined(__clang__)
437#define UPRV_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
439#define UPRV_NO_SANITIZE_UNDEFINED
447#if defined(__GNUC__) && __GNUC__>=3
448# define U_MALLOC_ATTR __attribute__ ((__malloc__))
450# define U_MALLOC_ATTR
458#if (defined(__GNUC__) && \
459 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
460 UPRV_HAS_ATTRIBUTE(alloc_size)
461# define U_ALLOC_SIZE_ATTR(X) __attribute__ ((alloc_size(X)))
462# define U_ALLOC_SIZE_ATTR2(X,Y) __attribute__ ((alloc_size(X,Y)))
464# define U_ALLOC_SIZE_ATTR(X)
465# define U_ALLOC_SIZE_ATTR2(X,Y)
474#ifdef U_CPLUSPLUS_VERSION
475# if U_CPLUSPLUS_VERSION != 0 && !defined(__cplusplus)
476# undef U_CPLUSPLUS_VERSION
477# define U_CPLUSPLUS_VERSION 0
480#elif !defined(__cplusplus)
481# define U_CPLUSPLUS_VERSION 0
482#elif __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
483# define U_CPLUSPLUS_VERSION 17
484#elif __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
485# define U_CPLUSPLUS_VERSION 14
486#elif __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
487# define U_CPLUSPLUS_VERSION 11
490# define U_CPLUSPLUS_VERSION 1
501#elif defined(U_FALLTHROUGH)
503#elif defined(__clang__)
506# if UPRV_HAS_CPP_ATTRIBUTE(clang::fallthrough) || \
507 (UPRV_HAS_FEATURE(cxx_attributes) && \
508 UPRV_HAS_WARNING("-Wimplicit-fallthrough"))
509# define U_FALLTHROUGH [[clang::fallthrough]]
511#elif defined(__GNUC__) && (__GNUC__ >= 7)
512# define U_FALLTHROUGH __attribute__((fallthrough))
516# define U_FALLTHROUGH
529#define U_ASCII_FAMILY 0
535#define U_EBCDIC_FAMILY 1
579#ifdef U_CHARSET_FAMILY
581#elif U_PLATFORM == U_PF_OS390 && (!defined(__CHARSET_LIB) || !__CHARSET_LIB)
582# define U_CHARSET_FAMILY U_EBCDIC_FAMILY
583#elif U_PLATFORM == U_PF_OS400 && !defined(__UTF32__)
584# define U_CHARSET_FAMILY U_EBCDIC_FAMILY
586# define U_CHARSET_FAMILY U_ASCII_FAMILY
609#ifdef U_CHARSET_IS_UTF8
611#elif U_PLATFORM_IS_LINUX_BASED || U_PLATFORM_IS_DARWIN_BASED || \
612 U_PLATFORM == U_PF_EMSCRIPTEN
613# define U_CHARSET_IS_UTF8 1
615# define U_CHARSET_IS_UTF8 0
632#elif U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9
638# define U_HAVE_WCHAR_H 0
640# define U_HAVE_WCHAR_H 1
649#ifdef U_SIZEOF_WCHAR_T
651#elif (U_PLATFORM == U_PF_ANDROID && __ANDROID_API__ < 9)
656# define U_SIZEOF_WCHAR_T 1
657#elif U_PLATFORM_HAS_WIN32_API || U_PLATFORM == U_PF_CYGWIN
658# define U_SIZEOF_WCHAR_T 2
659#elif U_PLATFORM == U_PF_AIX
669# define U_SIZEOF_WCHAR_T 4
671# define U_SIZEOF_WCHAR_T 2
673#elif U_PLATFORM == U_PF_OS390
680# define U_SIZEOF_WCHAR_T 4
682# define U_SIZEOF_WCHAR_T 2
684#elif U_PLATFORM == U_PF_OS400
685# if defined(__UTF32__)
691# define U_SIZEOF_WCHAR_T 4
692# elif defined(__UCS2__)
698# define U_SIZEOF_WCHAR_T 2
705# define U_SIZEOF_WCHAR_T 2
708# define U_SIZEOF_WCHAR_T 4
712#define U_HAVE_WCSCPY U_HAVE_WCHAR_H
725#ifdef U_HAVE_CHAR16_T
734# if defined(__cplusplus)
735# define U_HAVE_CHAR16_T 1
736# elif U_PLATFORM_IS_DARWIN_BASED || (U_PLATFORM == U_PF_CYGWIN && CYGWIN_VERSION_DLL_MAJOR < 3005)
737# define U_HAVE_CHAR16_T 0
740# define U_HAVE_CHAR16_T 1
753#ifdef U_DECLARE_UTF16
755#elif U_HAVE_CHAR16_T \
756 || (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
757 || (defined(__HP_aCC) && __HP_aCC >= 035000) \
758 || (defined(__HP_cc) && __HP_cc >= 111106) \
759 || (defined(U_IN_DOXYGEN))
760# define U_DECLARE_UTF16(string) u ## string
761#elif U_SIZEOF_WCHAR_T == 2 \
762 && (U_CHARSET_FAMILY == 0 || (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400 && defined(__UCS2__)))
763# define U_DECLARE_UTF16(string) L ## string
776#elif defined(U_STATIC_IMPLEMENTATION)
778#elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
779 UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
780# define U_EXPORT __declspec(dllexport)
781#elif defined(__GNUC__) || defined(__open_xl__)
782# define U_EXPORT __attribute__((visibility("default")))
783#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
784 || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
785# define U_EXPORT __global
795#elif defined(_MSC_VER)
796# define U_EXPORT2 __cdecl
803#elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
804 UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
806# define U_IMPORT __declspec(dllimport)
820#elif defined(__GNUC__) || defined(__open_xl__)
821# define U_HIDDEN __attribute__((visibility("hidden")))
843#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
844# define U_CALLCONV __cdecl
846# define U_CALLCONV U_EXPORT2
854#if U_PLATFORM == U_PF_OS390 && defined(__cplusplus)
855# define U_CALLCONV_FPTR U_CALLCONV
857# define U_CALLCONV_FPTR
User-configurable settings.
C API: definitions of ICU version numbers.