From 25cf8e9634dae6d34a2efc3c4a775c36b8eba603 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 4 Oct 2016 04:04:05 +0000 Subject: [PATCH] ICU-12773 digitlist/strtod_l patch on cygwin, merge r39420 X-SVN-Rev: 39425 --- icu4c/source/i18n/digitlst.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/icu4c/source/i18n/digitlst.cpp b/icu4c/source/i18n/digitlst.cpp index e157a3f84c5..f68f8bb3227 100644 --- a/icu4c/source/i18n/digitlst.cpp +++ b/icu4c/source/i18n/digitlst.cpp @@ -26,6 +26,10 @@ ****************************************************************************** */ +#if U_PLATFORM == U_PF_CYGWIN +#define _GNU_SOURCE +#endif + #include "digitlst.h" #if !UCONFIG_NO_FORMATTING @@ -47,7 +51,7 @@ #include #if !defined(U_USE_STRTOD_L) -# if U_PLATFORM_HAS_WIN32_API +# if U_PLATFORM_USES_ONLY_WIN32_API # define U_USE_STRTOD_L 1 # elif defined(U_HAVE_STRTOD_L) # define U_USE_STRTOD_L U_HAVE_STRTOD_L @@ -56,8 +60,12 @@ # endif #endif -#if U_USE_STRTOD_L && !U_PLATFORM_HAS_WIN32_API -#include +#if U_USE_STRTOD_L && !U_PLATFORM_USES_ONLY_WIN32_API +# if U_PLATFORM == U_PF_CYGWIN +# include +# else +# include +# endif #endif // *************************************************************************** @@ -479,7 +487,7 @@ DigitList::getDouble() const return tDouble; } -#if U_USE_STRTOD_L && U_PLATFORM_HAS_WIN32_API +#if U_USE_STRTOD_L && U_PLATFORM_USES_ONLY_WIN32_API # define locale_t _locale_t # define freelocale _free_locale # define strtod_l _strtod_l @@ -505,7 +513,7 @@ static UBool U_CALLCONV digitList_cleanup(void) static void U_CALLCONV initCLocale(void) { ucln_i18n_registerCleanup(UCLN_I18N_DIGITLIST, digitList_cleanup); #if U_USE_STRTOD_L -# if U_PLATFORM_HAS_WIN32_API +# if U_PLATFORM_USES_ONLY_WIN32_API gCLocale = _create_locale(LC_ALL, "C"); # else gCLocale = newlocale(LC_ALL_MASK, "C", (locale_t)0);