From ed68cff34e0d2827a9488e4fa772263227fc15c9 Mon Sep 17 00:00:00 2001 From: jeremyd2019 Date: Thu, 13 Jun 2024 12:36:19 -0700 Subject: [PATCH] ICU-22721 extend char16_t workaround to cygwin less than 3.5 uchar.h was added in Cygwin version 3.5.0. Unfortunately, the last version of Cygwin that supported i686 was 3.3.6, so it is still somewhat relevant to a subset of users. --- icu4c/source/common/unicode/platform.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index b8eb52d6ce68..33b1cd006ea4 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -154,6 +154,8 @@ # define U_PLATFORM U_PF_MINGW #elif defined(__CYGWIN__) # define U_PLATFORM U_PF_CYGWIN + /* Cygwin uchar.h doesn't exist until Cygwin 3.5. */ +# include #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) # define U_PLATFORM U_PF_WINDOWS #elif defined(__ANDROID__) @@ -722,9 +724,10 @@ /* * Notes: * C++11 and C11 require support for UTF-16 literals - * Doesn't work on Mac C11 (see workaround in ptypes.h). + * Doesn't work on Mac C11 (see workaround in ptypes.h) + * or Cygwin less than 3.5. */ -# if defined(__cplusplus) || !U_PLATFORM_IS_DARWIN_BASED +# if defined(__cplusplus) || !(U_PLATFORM_IS_DARWIN_BASED || (U_PLATFORM == U_PF_CYGWIN && CYGWIN_VERSION_DLL_MAJOR < 3005)) # define U_HAVE_CHAR16_T 1 # else # define U_HAVE_CHAR16_T 0