From 1aa9ba0a4224ae44c106fe75b998ce86758a3d9b Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Fri, 2 Sep 2016 23:23:14 +0000 Subject: [PATCH] ICU-10232 Fixed Mac/BSD build issue. X-SVN-Rev: 39128 --- icu4c/source/i18n/digitlst.cpp | 35 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/icu4c/source/i18n/digitlst.cpp b/icu4c/source/i18n/digitlst.cpp index 4e0f5df7f75..8809b86549d 100644 --- a/icu4c/source/i18n/digitlst.cpp +++ b/icu4c/source/i18n/digitlst.cpp @@ -29,6 +29,15 @@ #include "digitlst.h" #if !UCONFIG_NO_FORMATTING + +#if !defined(U_HAVE_STRTOD_L) +# if U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD || U_PLATFORM_HAS_WIN32_API +# define U_HAVE_STRTOD_L 1 +# else +# define U_HAVE_STRTOD_L 0 +# endif +#endif + #include "unicode/putil.h" #include "charstr.h" #include "cmemory.h" @@ -45,6 +54,10 @@ #include #include +#if U_HAVE_STRTOD_L && (U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM == U_PF_BSD) +#include +#endif + // *************************************************************************** // class DigitList // A wrapper onto decNumber. @@ -464,19 +477,15 @@ DigitList::getDouble() const return tDouble; } -#if !defined(U_HAVE_STRTOD_L) -# if U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD || U_PLATFORM_HAS_WIN32_API -# define U_HAVE_STRTOD_L 1 -# else -# define U_HAVE_STRTOD_L 0 -# endif -#endif - -#if U_HAVE_STRTOD_L && U_PLATFORM_HAS_WIN32_API -#define locale_t _locale_t -#define newlocale(cat, loc, base) _create_locale(cat, loc) -#define freelocale _free_locale -#define strtod_l _strtod_l +#if U_HAVE_STRTOD_L +# if U_PLATFORM_HAS_WIN32_API +# define locale_t _locale_t +# define newlocale(cat, loc, base) _create_locale(cat, loc) +# define freelocale _free_locale +# define strtod_l _strtod_l +# elif U_PLATFORM_IS_DARWIN_BASED || U_PLATFORM == U_PF_BSD +# define LC_ALL LC_ALL_MASK +# endif #endif #if U_HAVE_STRTOD_L -- 2.40.0