Fix build error 95/268295/1 sandbox/backup/icu_70.1_20211231 sandbox/dh0128.kwak/icu-70.1-20211210 accepted/tizen/base/20220112.062023 submit/tizen_base/20211229.230543 submit/tizen_base/20220103.001304
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 20 Dec 2021 04:59:29 +0000 (13:59 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 20 Dec 2021 04:59:29 +0000 (13:59 +0900)
- set U_DEFINE_FALSE_AND_TRUE 1 for build compotable

Change-Id: I50931faf67dbca6b73728d78de76a0d1f2f3f465

packaging/Set_define_false_and_true.patch [new file with mode: 0644]
packaging/icu.spec
source/common/unicode/umachine.h

diff --git a/packaging/Set_define_false_and_true.patch b/packaging/Set_define_false_and_true.patch
new file mode 100644 (file)
index 0000000..3ddb90e
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/source/common/unicode/umachine.h b/source/common/unicode/umachine.h
+index 344797a71..6fd504033 100644
+--- a/source/common/unicode/umachine.h
++++ b/source/common/unicode/umachine.h
+@@ -290,7 +290,7 @@ typedef int8_t UBool;
+ #   define U_DEFINE_FALSE_AND_TRUE 1
+ #else
+     // Outside ICU: Avoid collision with non-macro definitions of FALSE & TRUE.
+-#   define U_DEFINE_FALSE_AND_TRUE 0
++#   define U_DEFINE_FALSE_AND_TRUE 1
+ #endif
+
+ #if U_DEFINE_FALSE_AND_TRUE || defined(U_IN_DOXYGEN)
index 99326e1..e64523e 100644 (file)
@@ -17,6 +17,7 @@ Source1:   tzdata%{tzdata_version}.tar.gz
 Source2:   set_disable_renameing.patch
 Source3:   Disable-the-default-LDFLAGSICUDT.patch
 Source4:   Add_PIE_option_for_tzcode.patch
+Source5:   Set_define_false_and_true.patch
 
 Source1001:    icu.manifest
 BuildRequires: doxygen
@@ -65,6 +66,7 @@ cp %{SOURCE1001} .
 %{__patch} -p1 < %{SOURCE2}
 %{__patch} -p1 < %{SOURCE3}
 %{__patch} -p1 < %{SOURCE4}
+%{__patch} -p1 < %{SOURCE5}
 
 %if "%{?profile}" == "tv"
 cp %{SOURCE1} ./source/tools/tzcode
index 344797a..219d1ee 100644 (file)
-// © 2016 and later: Unicode, Inc. and others.\r
-// License & terms of use: http://www.unicode.org/copyright.html\r
-/*\r
-******************************************************************************\r
-*\r
-*   Copyright (C) 1999-2015, International Business Machines\r
-*   Corporation and others.  All Rights Reserved.\r
-*\r
-******************************************************************************\r
-*   file name:  umachine.h\r
-*   encoding:   UTF-8\r
-*   tab size:   8 (not used)\r
-*   indentation:4\r
-*\r
-*   created on: 1999sep13\r
-*   created by: Markus W. Scherer\r
-*\r
-*   This file defines basic types and constants for ICU to be\r
-*   platform-independent. umachine.h and utf.h are included into\r
-*   utypes.h to provide all the general definitions for ICU.\r
-*   All of these definitions used to be in utypes.h before\r
-*   the UTF-handling macros made this unmaintainable.\r
-*/\r
-\r
-#ifndef __UMACHINE_H__\r
-#define __UMACHINE_H__\r
-\r
-\r
-/**\r
- * \file\r
- * \brief Basic types and constants for UTF\r
- *\r
- * <h2> Basic types and constants for UTF </h2>\r
- *   This file defines basic types and constants for utf.h to be\r
- *   platform-independent. umachine.h and utf.h are included into\r
- *   utypes.h to provide all the general definitions for ICU.\r
- *   All of these definitions used to be in utypes.h before\r
- *   the UTF-handling macros made this unmaintainable.\r
- *\r
- */\r
-/*==========================================================================*/\r
-/* Include platform-dependent definitions                                   */\r
-/* which are contained in the platform-specific file platform.h             */\r
-/*==========================================================================*/\r
-\r
-#include "unicode/ptypes.h" /* platform.h is included in ptypes.h */\r
-\r
-/*\r
- * ANSI C headers:\r
- * stddef.h defines wchar_t\r
- */\r
-#include <stdbool.h>\r
-#include <stddef.h>\r
-\r
-/*==========================================================================*/\r
-/* For C wrappers, we use the symbol U_CAPI.                                */\r
-/* This works properly if the includer is C or C++.                         */\r
-/* Functions are declared   U_CAPI return-type U_EXPORT2 function-name()... */\r
-/*==========================================================================*/\r
-\r
-/**\r
- * \def U_CFUNC\r
- * This is used in a declaration of a library private ICU C function.\r
- * @stable ICU 2.4\r
- */\r
-\r
-/**\r
- * \def U_CDECL_BEGIN\r
- * This is used to begin a declaration of a library private ICU C API.\r
- * @stable ICU 2.4\r
- */\r
-\r
-/**\r
- * \def U_CDECL_END\r
- * This is used to end a declaration of a library private ICU C API\r
- * @stable ICU 2.4\r
- */\r
-\r
-#ifdef __cplusplus\r
-#   define U_CFUNC extern "C"\r
-#   define U_CDECL_BEGIN extern "C" {\r
-#   define U_CDECL_END   }\r
-#else\r
-#   define U_CFUNC extern\r
-#   define U_CDECL_BEGIN\r
-#   define U_CDECL_END\r
-#endif\r
-\r
-#ifndef U_ATTRIBUTE_DEPRECATED\r
-/**\r
- * \def U_ATTRIBUTE_DEPRECATED\r
- *  This is used for GCC specific attributes\r
- * @internal\r
- */\r
-#if U_GCC_MAJOR_MINOR >= 302\r
-#    define U_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))\r
-/**\r
- * \def U_ATTRIBUTE_DEPRECATED\r
- * This is used for Visual C++ specific attributes \r
- * @internal\r
- */\r
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)\r
-#    define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)\r
-#else\r
-#    define U_ATTRIBUTE_DEPRECATED\r
-#endif\r
-#endif\r
-\r
-/** This is used to declare a function as a public ICU C API @stable ICU 2.0*/\r
-#define U_CAPI U_CFUNC U_EXPORT\r
-/** Obsolete/same as U_CAPI; was used to declare a function as a stable public ICU C API*/\r
-#define U_STABLE U_CAPI\r
-/** Obsolete/same as U_CAPI; was used to declare a function as a draft public ICU C API  */\r
-#define U_DRAFT  U_CAPI\r
-/** This is used to declare a function as a deprecated public ICU C API  */\r
-#define U_DEPRECATED U_CAPI U_ATTRIBUTE_DEPRECATED\r
-/** Obsolete/same as U_CAPI; was used to declare a function as an obsolete public ICU C API  */\r
-#define U_OBSOLETE U_CAPI\r
-/** Obsolete/same as U_CAPI; was used to declare a function as an internal ICU C API  */\r
-#define U_INTERNAL U_CAPI\r
-\r
-/**\r
- * \def U_OVERRIDE\r
- * Defined to the C++11 "override" keyword if available.\r
- * Denotes a class or member which is an override of the base class.\r
- * May result in an error if it applied to something not an override.\r
- * @internal\r
- */\r
-#ifndef U_OVERRIDE\r
-#define U_OVERRIDE override\r
-#endif\r
-\r
-/**\r
- * \def U_FINAL\r
- * Defined to the C++11 "final" keyword if available.\r
- * Denotes a class or member which may not be overridden in subclasses.\r
- * May result in an error if subclasses attempt to override.\r
- * @internal\r
- */\r
-#if !defined(U_FINAL) || defined(U_IN_DOXYGEN)\r
-#define U_FINAL final\r
-#endif\r
-\r
-// Before ICU 65, function-like, multi-statement ICU macros were just defined as\r
-// series of statements wrapped in { } blocks and the caller could choose to\r
-// either treat them as if they were actual functions and end the invocation\r
-// with a trailing ; creating an empty statement after the block or else omit\r
-// this trailing ; using the knowledge that the macro would expand to { }.\r
-//\r
-// But doing so doesn't work well with macros that look like functions and\r
-// compiler warnings about empty statements (ICU-20601) and ICU 65 therefore\r
-// switches to the standard solution of wrapping such macros in do { } while.\r
-//\r
-// This will however break existing code that depends on being able to invoke\r
-// these macros without a trailing ; so to be able to remain compatible with\r
-// such code the wrapper is itself defined as macros so that it's possible to\r
-// build ICU 65 and later with the old macro behaviour, like this:\r
-//\r
-// export CPPFLAGS='-DUPRV_BLOCK_MACRO_BEGIN="" -DUPRV_BLOCK_MACRO_END=""'\r
-// runConfigureICU ...\r
-//\r
-\r
-/**\r
- * \def UPRV_BLOCK_MACRO_BEGIN\r
- * Defined as the "do" keyword by default.\r
- * @internal\r
- */\r
-#ifndef UPRV_BLOCK_MACRO_BEGIN\r
-#define UPRV_BLOCK_MACRO_BEGIN do\r
-#endif\r
-\r
-/**\r
- * \def UPRV_BLOCK_MACRO_END\r
- * Defined as "while (false)" by default.\r
- * @internal\r
- */\r
-#ifndef UPRV_BLOCK_MACRO_END\r
-#define UPRV_BLOCK_MACRO_END while (false)\r
-#endif\r
-\r
-/*==========================================================================*/\r
-/* limits for int32_t etc., like in POSIX inttypes.h                        */\r
-/*==========================================================================*/\r
-\r
-#ifndef INT8_MIN\r
-/** The smallest value an 8 bit signed integer can hold @stable ICU 2.0 */\r
-#   define INT8_MIN        ((int8_t)(-128))\r
-#endif\r
-#ifndef INT16_MIN\r
-/** The smallest value a 16 bit signed integer can hold @stable ICU 2.0 */\r
-#   define INT16_MIN       ((int16_t)(-32767-1))\r
-#endif\r
-#ifndef INT32_MIN\r
-/** The smallest value a 32 bit signed integer can hold @stable ICU 2.0 */\r
-#   define INT32_MIN       ((int32_t)(-2147483647-1))\r
-#endif\r
-\r
-#ifndef INT8_MAX\r
-/** The largest value an 8 bit signed integer can hold @stable ICU 2.0 */\r
-#   define INT8_MAX        ((int8_t)(127))\r
-#endif\r
-#ifndef INT16_MAX\r
-/** The largest value a 16 bit signed integer can hold @stable ICU 2.0 */\r
-#   define INT16_MAX       ((int16_t)(32767))\r
-#endif\r
-#ifndef INT32_MAX\r
-/** The largest value a 32 bit signed integer can hold @stable ICU 2.0 */\r
-#   define INT32_MAX       ((int32_t)(2147483647))\r
-#endif\r
-\r
-#ifndef UINT8_MAX\r
-/** The largest value an 8 bit unsigned integer can hold @stable ICU 2.0 */\r
-#   define UINT8_MAX       ((uint8_t)(255U))\r
-#endif\r
-#ifndef UINT16_MAX\r
-/** The largest value a 16 bit unsigned integer can hold @stable ICU 2.0 */\r
-#   define UINT16_MAX      ((uint16_t)(65535U))\r
-#endif\r
-#ifndef UINT32_MAX\r
-/** The largest value a 32 bit unsigned integer can hold @stable ICU 2.0 */\r
-#   define UINT32_MAX      ((uint32_t)(4294967295U))\r
-#endif\r
-\r
-#if defined(U_INT64_T_UNAVAILABLE)\r
-# error int64_t is required for decimal format and rule-based number format.\r
-#else\r
-# ifndef INT64_C\r
-/**\r
- * Provides a platform independent way to specify a signed 64-bit integer constant.\r
- * note: may be wrong for some 64 bit platforms - ensure your compiler provides INT64_C\r
- * @stable ICU 2.8\r
- */\r
-#   define INT64_C(c) c ## LL\r
-# endif\r
-# ifndef UINT64_C\r
-/**\r
- * Provides a platform independent way to specify an unsigned 64-bit integer constant.\r
- * note: may be wrong for some 64 bit platforms - ensure your compiler provides UINT64_C\r
- * @stable ICU 2.8\r
- */\r
-#   define UINT64_C(c) c ## ULL\r
-# endif\r
-# ifndef U_INT64_MIN\r
-/** The smallest value a 64 bit signed integer can hold @stable ICU 2.8 */\r
-#     define U_INT64_MIN       ((int64_t)(INT64_C(-9223372036854775807)-1))\r
-# endif\r
-# ifndef U_INT64_MAX\r
-/** The largest value a 64 bit signed integer can hold @stable ICU 2.8 */\r
-#     define U_INT64_MAX       ((int64_t)(INT64_C(9223372036854775807)))\r
-# endif\r
-# ifndef U_UINT64_MAX\r
-/** The largest value a 64 bit unsigned integer can hold @stable ICU 2.8 */\r
-#     define U_UINT64_MAX      ((uint64_t)(UINT64_C(18446744073709551615)))\r
-# endif\r
-#endif\r
-\r
-/*==========================================================================*/\r
-/* Boolean data type                                                        */\r
-/*==========================================================================*/\r
-\r
-/**\r
- * The ICU boolean type, a signed-byte integer.\r
- * ICU-specific for historical reasons: The C and C++ standards used to not define type bool.\r
- * Also provides a fixed type definition, as opposed to\r
- * type bool whose details (e.g., sizeof) may vary by compiler and between C and C++.\r
- *\r
- * @stable ICU 2.0\r
- */\r
-typedef int8_t UBool;\r
-\r
-/**\r
- * \def U_DEFINE_FALSE_AND_TRUE\r
- * Normally turns off defining macros FALSE=0 & TRUE=1 in public ICU headers.\r
- * These obsolete macros sometimes break compilation of other code that\r
- * defines enum constants or similar with these names.\r
- * C++ has long defined bool/false/true.\r
- * C99 also added definitions for these, although as macros; see stdbool.h.\r
- *\r
- * You may transitionally define U_DEFINE_FALSE_AND_TRUE=1 if you need time to migrate code.\r
- *\r
- * @internal ICU 68\r
- */\r
-#ifdef U_DEFINE_FALSE_AND_TRUE\r
-    // Use the predefined value.\r
-#elif defined(U_COMBINED_IMPLEMENTATION) || \\r
-        defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \\r
-        defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \\r
-        defined(U_TOOLUTIL_IMPLEMENTATION)\r
-    // Inside ICU: Keep FALSE & TRUE available.\r
-#   define U_DEFINE_FALSE_AND_TRUE 1\r
-#else\r
-    // Outside ICU: Avoid collision with non-macro definitions of FALSE & TRUE.\r
-#   define U_DEFINE_FALSE_AND_TRUE 0\r
-#endif\r
-\r
-#if U_DEFINE_FALSE_AND_TRUE || defined(U_IN_DOXYGEN)\r
-#ifndef TRUE\r
-/**\r
- * The TRUE value of a UBool.\r
- *\r
- * @deprecated ICU 68 Use standard "true" instead.\r
- */\r
-#   define TRUE  1\r
-#endif\r
-#ifndef FALSE\r
-/**\r
- * The FALSE value of a UBool.\r
- *\r
- * @deprecated ICU 68 Use standard "false" instead.\r
- */\r
-#   define FALSE 0\r
-#endif\r
-#endif  // U_DEFINE_FALSE_AND_TRUE\r
-\r
-/*==========================================================================*/\r
-/* Unicode data types                                                       */\r
-/*==========================================================================*/\r
-\r
-/* wchar_t-related definitions -------------------------------------------- */\r
-\r
-/*\r
- * \def U_WCHAR_IS_UTF16\r
- * Defined if wchar_t uses UTF-16.\r
- *\r
- * @stable ICU 2.0\r
- */\r
-/*\r
- * \def U_WCHAR_IS_UTF32\r
- * Defined if wchar_t uses UTF-32.\r
- *\r
- * @stable ICU 2.0\r
- */\r
-#if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)\r
-#   ifdef __STDC_ISO_10646__\r
-#       if (U_SIZEOF_WCHAR_T==2)\r
-#           define U_WCHAR_IS_UTF16\r
-#       elif (U_SIZEOF_WCHAR_T==4)\r
-#           define  U_WCHAR_IS_UTF32\r
-#       endif\r
-#   elif defined __UCS2__\r
-#       if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2)\r
-#           define U_WCHAR_IS_UTF16\r
-#       endif\r
-#   elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__))\r
-#       if (U_SIZEOF_WCHAR_T==4)\r
-#           define U_WCHAR_IS_UTF32\r
-#       endif\r
-#   elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED)\r
-#       define U_WCHAR_IS_UTF32\r
-#   elif U_PLATFORM_HAS_WIN32_API\r
-#       define U_WCHAR_IS_UTF16\r
-#   endif\r
-#endif\r
-\r
-/* UChar and UChar32 definitions -------------------------------------------- */\r
-\r
-/** Number of bytes in a UChar. @stable ICU 2.0 */\r
-#define U_SIZEOF_UCHAR 2\r
-\r
-/**\r
- * \def U_CHAR16_IS_TYPEDEF\r
- * If 1, then char16_t is a typedef and not a real type (yet)\r
- * @internal\r
- */\r
-#if (U_PLATFORM == U_PF_AIX) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11)\r
-// for AIX, uchar.h needs to be included\r
-# include <uchar.h>\r
-# define U_CHAR16_IS_TYPEDEF 1\r
-#elif defined(_MSC_VER) && (_MSC_VER < 1900)\r
-// Versions of Visual Studio/MSVC below 2015 do not support char16_t as a real type,\r
-// and instead use a typedef.  https://msdn.microsoft.com/library/bb531344.aspx\r
-# define U_CHAR16_IS_TYPEDEF 1\r
-#else\r
-# define U_CHAR16_IS_TYPEDEF 0\r
-#endif\r
-\r
-\r
-/**\r
- * \var UChar\r
- *\r
- * The base type for UTF-16 code units and pointers.\r
- * Unsigned 16-bit integer.\r
- * Starting with ICU 59, C++ API uses char16_t directly, while C API continues to use UChar.\r
- *\r
- * UChar is configurable by defining the macro UCHAR_TYPE\r
- * on the preprocessor or compiler command line:\r
- * -DUCHAR_TYPE=uint16_t or -DUCHAR_TYPE=wchar_t (if U_SIZEOF_WCHAR_T==2) etc.\r
- * (The UCHAR_TYPE can also be \#defined earlier in this file, for outside the ICU library code.)\r
- * This is for transitional use from application code that uses uint16_t or wchar_t for UTF-16.\r
- *\r
- * The default is UChar=char16_t.\r
- *\r
- * C++11 defines char16_t as bit-compatible with uint16_t, but as a distinct type.\r
- *\r
- * In C, char16_t is a simple typedef of uint_least16_t.\r
- * ICU requires uint_least16_t=uint16_t for data memory mapping.\r
- * On macOS, char16_t is not available because the uchar.h standard header is missing.\r
- *\r
- * @stable ICU 4.4\r
- */\r
-\r
-#if 1\r
-    // #if 1 is normal. UChar defaults to char16_t in C++.\r
-    // For configuration testing of UChar=uint16_t temporarily change this to #if 0.\r
-    // The intltest Makefile #defines UCHAR_TYPE=char16_t,\r
-    // so we only #define it to uint16_t if it is undefined so far.\r
-#elif !defined(UCHAR_TYPE)\r
-#   define UCHAR_TYPE uint16_t\r
-#endif\r
-\r
-#if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \\r
-        defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)\r
-    // Inside the ICU library code, never configurable.\r
-    typedef char16_t UChar;\r
-#elif defined(UCHAR_TYPE)\r
-    typedef UCHAR_TYPE UChar;\r
-#elif (U_CPLUSPLUS_VERSION >= 11)\r
-    typedef char16_t UChar;\r
-#else\r
-    typedef uint16_t UChar;\r
-#endif\r
-\r
-/**\r
- * \var OldUChar\r
- * Default ICU 58 definition of UChar.\r
- * A base type for UTF-16 code units and pointers.\r
- * Unsigned 16-bit integer.\r
- *\r
- * Define OldUChar to be wchar_t if that is 16 bits wide.\r
- * If wchar_t is not 16 bits wide, then define UChar to be uint16_t.\r
- *\r
- * This makes the definition of OldUChar platform-dependent\r
- * but allows direct string type compatibility with platforms with\r
- * 16-bit wchar_t types.\r
- *\r
- * This is how UChar was defined in ICU 58, for transition convenience.\r
- * Exception: ICU 58 UChar was defined to UCHAR_TYPE if that macro was defined.\r
- * The current UChar responds to UCHAR_TYPE but OldUChar does not.\r
- *\r
- * @stable ICU 59\r
- */\r
-#if U_SIZEOF_WCHAR_T==2\r
-    typedef wchar_t OldUChar;\r
-#elif defined(__CHAR16_TYPE__)\r
-    typedef __CHAR16_TYPE__ OldUChar;\r
-#else\r
-    typedef uint16_t OldUChar;\r
-#endif\r
-\r
-/**\r
- * Define UChar32 as a type for single Unicode code points.\r
- * UChar32 is a signed 32-bit integer (same as int32_t).\r
- *\r
- * The Unicode code point range is 0..0x10ffff.\r
- * All other values (negative or >=0x110000) are illegal as Unicode code points.\r
- * They may be used as sentinel values to indicate "done", "error"\r
- * or similar non-code point conditions.\r
- *\r
- * Before ICU 2.4 (Jitterbug 2146), UChar32 was defined\r
- * to be wchar_t if that is 32 bits wide (wchar_t may be signed or unsigned)\r
- * or else to be uint32_t.\r
- * That is, the definition of UChar32 was platform-dependent.\r
- *\r
- * @see U_SENTINEL\r
- * @stable ICU 2.4\r
- */\r
-typedef int32_t UChar32;\r
-\r
-/**\r
- * This value is intended for sentinel values for APIs that\r
- * (take or) return single code points (UChar32).\r
- * It is outside of the Unicode code point range 0..0x10ffff.\r
- * \r
- * For example, a "done" or "error" value in a new API\r
- * could be indicated with U_SENTINEL.\r
- *\r
- * ICU APIs designed before ICU 2.4 usually define service-specific "done"\r
- * values, mostly 0xffff.\r
- * Those may need to be distinguished from\r
- * actual U+ffff text contents by calling functions like\r
- * CharacterIterator::hasNext() or UnicodeString::length().\r
- *\r
- * @return -1\r
- * @see UChar32\r
- * @stable ICU 2.4\r
- */\r
-#define U_SENTINEL (-1)\r
-\r
-#include "unicode/urename.h"\r
-\r
-#endif\r
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+/*
+******************************************************************************
+*
+*   Copyright (C) 1999-2015, International Business Machines
+*   Corporation and others.  All Rights Reserved.
+*
+******************************************************************************
+*   file name:  umachine.h
+*   encoding:   UTF-8
+*   tab size:   8 (not used)
+*   indentation:4
+*
+*   created on: 1999sep13
+*   created by: Markus W. Scherer
+*
+*   This file defines basic types and constants for ICU to be
+*   platform-independent. umachine.h and utf.h are included into
+*   utypes.h to provide all the general definitions for ICU.
+*   All of these definitions used to be in utypes.h before
+*   the UTF-handling macros made this unmaintainable.
+*/
+
+#ifndef __UMACHINE_H__
+#define __UMACHINE_H__
+
+
+/**
+ * \file
+ * \brief Basic types and constants for UTF
+ *
+ * <h2> Basic types and constants for UTF </h2>
+ *   This file defines basic types and constants for utf.h to be
+ *   platform-independent. umachine.h and utf.h are included into
+ *   utypes.h to provide all the general definitions for ICU.
+ *   All of these definitions used to be in utypes.h before
+ *   the UTF-handling macros made this unmaintainable.
+ *
+ */
+/*==========================================================================*/
+/* Include platform-dependent definitions                                   */
+/* which are contained in the platform-specific file platform.h             */
+/*==========================================================================*/
+
+#include "unicode/ptypes.h" /* platform.h is included in ptypes.h */
+
+/*
+ * ANSI C headers:
+ * stddef.h defines wchar_t
+ */
+#include <stdbool.h>
+#include <stddef.h>
+
+/*==========================================================================*/
+/* For C wrappers, we use the symbol U_CAPI.                                */
+/* This works properly if the includer is C or C++.                         */
+/* Functions are declared   U_CAPI return-type U_EXPORT2 function-name()... */
+/*==========================================================================*/
+
+/**
+ * \def U_CFUNC
+ * This is used in a declaration of a library private ICU C function.
+ * @stable ICU 2.4
+ */
+
+/**
+ * \def U_CDECL_BEGIN
+ * This is used to begin a declaration of a library private ICU C API.
+ * @stable ICU 2.4
+ */
+
+/**
+ * \def U_CDECL_END
+ * This is used to end a declaration of a library private ICU C API
+ * @stable ICU 2.4
+ */
+
+#ifdef __cplusplus
+#   define U_CFUNC extern "C"
+#   define U_CDECL_BEGIN extern "C" {
+#   define U_CDECL_END   }
+#else
+#   define U_CFUNC extern
+#   define U_CDECL_BEGIN
+#   define U_CDECL_END
+#endif
+
+#ifndef U_ATTRIBUTE_DEPRECATED
+/**
+ * \def U_ATTRIBUTE_DEPRECATED
+ *  This is used for GCC specific attributes
+ * @internal
+ */
+#if U_GCC_MAJOR_MINOR >= 302
+#    define U_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
+/**
+ * \def U_ATTRIBUTE_DEPRECATED
+ * This is used for Visual C++ specific attributes
+ * @internal
+ */
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#    define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
+#else
+#    define U_ATTRIBUTE_DEPRECATED
+#endif
+#endif
+
+/** This is used to declare a function as a public ICU C API @stable ICU 2.0*/
+#define U_CAPI U_CFUNC U_EXPORT
+/** Obsolete/same as U_CAPI; was used to declare a function as a stable public ICU C API*/
+#define U_STABLE U_CAPI
+/** Obsolete/same as U_CAPI; was used to declare a function as a draft public ICU C API  */
+#define U_DRAFT  U_CAPI
+/** This is used to declare a function as a deprecated public ICU C API  */
+#define U_DEPRECATED U_CAPI U_ATTRIBUTE_DEPRECATED
+/** Obsolete/same as U_CAPI; was used to declare a function as an obsolete public ICU C API  */
+#define U_OBSOLETE U_CAPI
+/** Obsolete/same as U_CAPI; was used to declare a function as an internal ICU C API  */
+#define U_INTERNAL U_CAPI
+
+/**
+ * \def U_OVERRIDE
+ * Defined to the C++11 "override" keyword if available.
+ * Denotes a class or member which is an override of the base class.
+ * May result in an error if it applied to something not an override.
+ * @internal
+ */
+#ifndef U_OVERRIDE
+#define U_OVERRIDE override
+#endif
+
+/**
+ * \def U_FINAL
+ * Defined to the C++11 "final" keyword if available.
+ * Denotes a class or member which may not be overridden in subclasses.
+ * May result in an error if subclasses attempt to override.
+ * @internal
+ */
+#if !defined(U_FINAL) || defined(U_IN_DOXYGEN)
+#define U_FINAL final
+#endif
+
+// Before ICU 65, function-like, multi-statement ICU macros were just defined as
+// series of statements wrapped in { } blocks and the caller could choose to
+// either treat them as if they were actual functions and end the invocation
+// with a trailing ; creating an empty statement after the block or else omit
+// this trailing ; using the knowledge that the macro would expand to { }.
+//
+// But doing so doesn't work well with macros that look like functions and
+// compiler warnings about empty statements (ICU-20601) and ICU 65 therefore
+// switches to the standard solution of wrapping such macros in do { } while.
+//
+// This will however break existing code that depends on being able to invoke
+// these macros without a trailing ; so to be able to remain compatible with
+// such code the wrapper is itself defined as macros so that it's possible to
+// build ICU 65 and later with the old macro behaviour, like this:
+//
+// export CPPFLAGS='-DUPRV_BLOCK_MACRO_BEGIN="" -DUPRV_BLOCK_MACRO_END=""'
+// runConfigureICU ...
+//
+
+/**
+ * \def UPRV_BLOCK_MACRO_BEGIN
+ * Defined as the "do" keyword by default.
+ * @internal
+ */
+#ifndef UPRV_BLOCK_MACRO_BEGIN
+#define UPRV_BLOCK_MACRO_BEGIN do
+#endif
+
+/**
+ * \def UPRV_BLOCK_MACRO_END
+ * Defined as "while (false)" by default.
+ * @internal
+ */
+#ifndef UPRV_BLOCK_MACRO_END
+#define UPRV_BLOCK_MACRO_END while (false)
+#endif
+
+/*==========================================================================*/
+/* limits for int32_t etc., like in POSIX inttypes.h                        */
+/*==========================================================================*/
+
+#ifndef INT8_MIN
+/** The smallest value an 8 bit signed integer can hold @stable ICU 2.0 */
+#   define INT8_MIN        ((int8_t)(-128))
+#endif
+#ifndef INT16_MIN
+/** The smallest value a 16 bit signed integer can hold @stable ICU 2.0 */
+#   define INT16_MIN       ((int16_t)(-32767-1))
+#endif
+#ifndef INT32_MIN
+/** The smallest value a 32 bit signed integer can hold @stable ICU 2.0 */
+#   define INT32_MIN       ((int32_t)(-2147483647-1))
+#endif
+
+#ifndef INT8_MAX
+/** The largest value an 8 bit signed integer can hold @stable ICU 2.0 */
+#   define INT8_MAX        ((int8_t)(127))
+#endif
+#ifndef INT16_MAX
+/** The largest value a 16 bit signed integer can hold @stable ICU 2.0 */
+#   define INT16_MAX       ((int16_t)(32767))
+#endif
+#ifndef INT32_MAX
+/** The largest value a 32 bit signed integer can hold @stable ICU 2.0 */
+#   define INT32_MAX       ((int32_t)(2147483647))
+#endif
+
+#ifndef UINT8_MAX
+/** The largest value an 8 bit unsigned integer can hold @stable ICU 2.0 */
+#   define UINT8_MAX       ((uint8_t)(255U))
+#endif
+#ifndef UINT16_MAX
+/** The largest value a 16 bit unsigned integer can hold @stable ICU 2.0 */
+#   define UINT16_MAX      ((uint16_t)(65535U))
+#endif
+#ifndef UINT32_MAX
+/** The largest value a 32 bit unsigned integer can hold @stable ICU 2.0 */
+#   define UINT32_MAX      ((uint32_t)(4294967295U))
+#endif
+
+#if defined(U_INT64_T_UNAVAILABLE)
+# error int64_t is required for decimal format and rule-based number format.
+#else
+# ifndef INT64_C
+/**
+ * Provides a platform independent way to specify a signed 64-bit integer constant.
+ * note: may be wrong for some 64 bit platforms - ensure your compiler provides INT64_C
+ * @stable ICU 2.8
+ */
+#   define INT64_C(c) c ## LL
+# endif
+# ifndef UINT64_C
+/**
+ * Provides a platform independent way to specify an unsigned 64-bit integer constant.
+ * note: may be wrong for some 64 bit platforms - ensure your compiler provides UINT64_C
+ * @stable ICU 2.8
+ */
+#   define UINT64_C(c) c ## ULL
+# endif
+# ifndef U_INT64_MIN
+/** The smallest value a 64 bit signed integer can hold @stable ICU 2.8 */
+#     define U_INT64_MIN       ((int64_t)(INT64_C(-9223372036854775807)-1))
+# endif
+# ifndef U_INT64_MAX
+/** The largest value a 64 bit signed integer can hold @stable ICU 2.8 */
+#     define U_INT64_MAX       ((int64_t)(INT64_C(9223372036854775807)))
+# endif
+# ifndef U_UINT64_MAX
+/** The largest value a 64 bit unsigned integer can hold @stable ICU 2.8 */
+#     define U_UINT64_MAX      ((uint64_t)(UINT64_C(18446744073709551615)))
+# endif
+#endif
+
+/*==========================================================================*/
+/* Boolean data type                                                        */
+/*==========================================================================*/
+
+/**
+ * The ICU boolean type, a signed-byte integer.
+ * ICU-specific for historical reasons: The C and C++ standards used to not define type bool.
+ * Also provides a fixed type definition, as opposed to
+ * type bool whose details (e.g., sizeof) may vary by compiler and between C and C++.
+ *
+ * @stable ICU 2.0
+ */
+typedef int8_t UBool;
+
+/**
+ * \def U_DEFINE_FALSE_AND_TRUE
+ * Normally turns off defining macros FALSE=0 & TRUE=1 in public ICU headers.
+ * These obsolete macros sometimes break compilation of other code that
+ * defines enum constants or similar with these names.
+ * C++ has long defined bool/false/true.
+ * C99 also added definitions for these, although as macros; see stdbool.h.
+ *
+ * You may transitionally define U_DEFINE_FALSE_AND_TRUE=1 if you need time to migrate code.
+ *
+ * @internal ICU 68
+ */
+#ifdef U_DEFINE_FALSE_AND_TRUE
+    // Use the predefined value.
+#elif defined(U_COMBINED_IMPLEMENTATION) || \
+        defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || \
+        defined(U_IO_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || \
+        defined(U_TOOLUTIL_IMPLEMENTATION)
+    // Inside ICU: Keep FALSE & TRUE available.
+#   define U_DEFINE_FALSE_AND_TRUE 1
+#else
+    // Outside ICU: Avoid collision with non-macro definitions of FALSE & TRUE.
+#   define U_DEFINE_FALSE_AND_TRUE 0
+#endif
+
+#if U_DEFINE_FALSE_AND_TRUE || defined(U_IN_DOXYGEN)
+#ifndef TRUE
+/**
+ * The TRUE value of a UBool.
+ *
+ * @deprecated ICU 68 Use standard "true" instead.
+ */
+#   define TRUE  1
+#endif
+#ifndef FALSE
+/**
+ * The FALSE value of a UBool.
+ *
+ * @deprecated ICU 68 Use standard "false" instead.
+ */
+#   define FALSE 0
+#endif
+#endif  // U_DEFINE_FALSE_AND_TRUE
+
+/*==========================================================================*/
+/* Unicode data types                                                       */
+/*==========================================================================*/
+
+/* wchar_t-related definitions -------------------------------------------- */
+
+/*
+ * \def U_WCHAR_IS_UTF16
+ * Defined if wchar_t uses UTF-16.
+ *
+ * @stable ICU 2.0
+ */
+/*
+ * \def U_WCHAR_IS_UTF32
+ * Defined if wchar_t uses UTF-32.
+ *
+ * @stable ICU 2.0
+ */
+#if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
+#   ifdef __STDC_ISO_10646__
+#       if (U_SIZEOF_WCHAR_T==2)
+#           define U_WCHAR_IS_UTF16
+#       elif (U_SIZEOF_WCHAR_T==4)
+#           define  U_WCHAR_IS_UTF32
+#       endif
+#   elif defined __UCS2__
+#       if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2)
+#           define U_WCHAR_IS_UTF16
+#       endif
+#   elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__))
+#       if (U_SIZEOF_WCHAR_T==4)
+#           define U_WCHAR_IS_UTF32
+#       endif
+#   elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED)
+#       define U_WCHAR_IS_UTF32
+#   elif U_PLATFORM_HAS_WIN32_API
+#       define U_WCHAR_IS_UTF16
+#   endif
+#endif
+
+/* UChar and UChar32 definitions -------------------------------------------- */
+
+/** Number of bytes in a UChar. @stable ICU 2.0 */
+#define U_SIZEOF_UCHAR 2
+
+/**
+ * \def U_CHAR16_IS_TYPEDEF
+ * If 1, then char16_t is a typedef and not a real type (yet)
+ * @internal
+ */
+#if (U_PLATFORM == U_PF_AIX) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11)
+// for AIX, uchar.h needs to be included
+# include <uchar.h>
+# define U_CHAR16_IS_TYPEDEF 1
+#elif defined(_MSC_VER) && (_MSC_VER < 1900)
+// Versions of Visual Studio/MSVC below 2015 do not support char16_t as a real type,
+// and instead use a typedef.  https://msdn.microsoft.com/library/bb531344.aspx
+# define U_CHAR16_IS_TYPEDEF 1
+#else
+# define U_CHAR16_IS_TYPEDEF 0
+#endif
+
+
+/**
+ * \var UChar
+ *
+ * The base type for UTF-16 code units and pointers.
+ * Unsigned 16-bit integer.
+ * Starting with ICU 59, C++ API uses char16_t directly, while C API continues to use UChar.
+ *
+ * UChar is configurable by defining the macro UCHAR_TYPE
+ * on the preprocessor or compiler command line:
+ * -DUCHAR_TYPE=uint16_t or -DUCHAR_TYPE=wchar_t (if U_SIZEOF_WCHAR_T==2) etc.
+ * (The UCHAR_TYPE can also be \#defined earlier in this file, for outside the ICU library code.)
+ * This is for transitional use from application code that uses uint16_t or wchar_t for UTF-16.
+ *
+ * The default is UChar=char16_t.
+ *
+ * C++11 defines char16_t as bit-compatible with uint16_t, but as a distinct type.
+ *
+ * In C, char16_t is a simple typedef of uint_least16_t.
+ * ICU requires uint_least16_t=uint16_t for data memory mapping.
+ * On macOS, char16_t is not available because the uchar.h standard header is missing.
+ *
+ * @stable ICU 4.4
+ */
+
+#if 1
+    // #if 1 is normal. UChar defaults to char16_t in C++.
+    // For configuration testing of UChar=uint16_t temporarily change this to #if 0.
+    // The intltest Makefile #defines UCHAR_TYPE=char16_t,
+    // so we only #define it to uint16_t if it is undefined so far.
+#elif !defined(UCHAR_TYPE)
+#   define UCHAR_TYPE uint16_t
+#endif
+
+#if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || \
+        defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
+    // Inside the ICU library code, never configurable.
+    typedef char16_t UChar;
+#elif defined(UCHAR_TYPE)
+    typedef UCHAR_TYPE UChar;
+#elif (U_CPLUSPLUS_VERSION >= 11)
+    typedef char16_t UChar;
+#else
+    typedef uint16_t UChar;
+#endif
+
+/**
+ * \var OldUChar
+ * Default ICU 58 definition of UChar.
+ * A base type for UTF-16 code units and pointers.
+ * Unsigned 16-bit integer.
+ *
+ * Define OldUChar to be wchar_t if that is 16 bits wide.
+ * If wchar_t is not 16 bits wide, then define UChar to be uint16_t.
+ *
+ * This makes the definition of OldUChar platform-dependent
+ * but allows direct string type compatibility with platforms with
+ * 16-bit wchar_t types.
+ *
+ * This is how UChar was defined in ICU 58, for transition convenience.
+ * Exception: ICU 58 UChar was defined to UCHAR_TYPE if that macro was defined.
+ * The current UChar responds to UCHAR_TYPE but OldUChar does not.
+ *
+ * @stable ICU 59
+ */
+#if U_SIZEOF_WCHAR_T==2
+    typedef wchar_t OldUChar;
+#elif defined(__CHAR16_TYPE__)
+    typedef __CHAR16_TYPE__ OldUChar;
+#else
+    typedef uint16_t OldUChar;
+#endif
+
+/**
+ * Define UChar32 as a type for single Unicode code points.
+ * UChar32 is a signed 32-bit integer (same as int32_t).
+ *
+ * The Unicode code point range is 0..0x10ffff.
+ * All other values (negative or >=0x110000) are illegal as Unicode code points.
+ * They may be used as sentinel values to indicate "done", "error"
+ * or similar non-code point conditions.
+ *
+ * Before ICU 2.4 (Jitterbug 2146), UChar32 was defined
+ * to be wchar_t if that is 32 bits wide (wchar_t may be signed or unsigned)
+ * or else to be uint32_t.
+ * That is, the definition of UChar32 was platform-dependent.
+ *
+ * @see U_SENTINEL
+ * @stable ICU 2.4
+ */
+typedef int32_t UChar32;
+
+/**
+ * This value is intended for sentinel values for APIs that
+ * (take or) return single code points (UChar32).
+ * It is outside of the Unicode code point range 0..0x10ffff.
+ *
+ * For example, a "done" or "error" value in a new API
+ * could be indicated with U_SENTINEL.
+ *
+ * ICU APIs designed before ICU 2.4 usually define service-specific "done"
+ * values, mostly 0xffff.
+ * Those may need to be distinguished from
+ * actual U+ffff text contents by calling functions like
+ * CharacterIterator::hasNext() or UnicodeString::length().
+ *
+ * @return -1
+ * @see UChar32
+ * @stable ICU 2.4
+ */
+#define U_SENTINEL (-1)
+
+#include "unicode/urename.h"
+
+#endif