summaryrefslogtreecommitdiff
path: root/src/corefx
diff options
context:
space:
mode:
authorSteve Harter <sharter@microsoft.com>2015-10-01 17:18:00 -0500
committerSteve Harter <sharter@microsoft.com>2015-10-05 12:09:22 -0500
commit4c11093793d420093e3a0eba51de31b804afc269 (patch)
tree9ee3303dcdaf95dd76ba077e95e758b593fd9a2e /src/corefx
parentf4560c6e113741d2296f2ebbc4cd6e6427b57a88 (diff)
downloadcoreclr-4c11093793d420093e3a0eba51de31b804afc269.tar.gz
coreclr-4c11093793d420093e3a0eba51de31b804afc269.tar.bz2
coreclr-4c11093793d420093e3a0eba51de31b804afc269.zip
Fix ICU compile error on CentOS by using DateFormatSymbols::NARROW insead of SHORT as SHORT is not defined in the version 50 of ICU being used by Centos. SHORT was added in ICU 51.
Diffstat (limited to 'src/corefx')
-rw-r--r--src/corefx/System.Globalization.Native/CMakeLists.txt10
-rw-r--r--src/corefx/System.Globalization.Native/calendarData.cpp5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/corefx/System.Globalization.Native/CMakeLists.txt b/src/corefx/System.Globalization.Native/CMakeLists.txt
index 2660e34045..4155fbb253 100644
--- a/src/corefx/System.Globalization.Native/CMakeLists.txt
+++ b/src/corefx/System.Globalization.Native/CMakeLists.txt
@@ -27,6 +27,16 @@ if(UTYPES_H STREQUAL UTYPES_H-NOTFOUND)
return()
endif()
+set(CMAKE_REQUIRED_INCLUDES ${ICU_HOMEBREW_INC_PATH})
+CHECK_CXX_SOURCE_COMPILES("
+ #include <unicode/dtfmtsym.h>
+ int main() { DateFormatSymbols::DtWidthType e = DateFormatSymbols::DtWidthType::SHORT; }
+" HAVE_DTWIDTHTYPE_SHORT)
+
+if(HAVE_DTWIDTHTYPE_SHORT)
+ add_definitions(-DHAVE_DTWIDTHTYPE_SHORT=1)
+endif(HAVE_DTWIDTHTYPE_SHORT)
+
add_compile_options(-fPIC)
set(NATIVEGLOBALIZATION_SOURCES
diff --git a/src/corefx/System.Globalization.Native/calendarData.cpp b/src/corefx/System.Globalization.Native/calendarData.cpp
index 1fc61167af..81583950a1 100644
--- a/src/corefx/System.Globalization.Native/calendarData.cpp
+++ b/src/corefx/System.Globalization.Native/calendarData.cpp
@@ -498,7 +498,12 @@ extern "C" int32_t EnumCalendarInfo(
case AbbrevMonthNames:
return EnumMonths(locale, calendarId, DateFormatSymbols::STANDALONE, DateFormatSymbols::ABBREVIATED, callback, context);
case SuperShortDayNames:
+#ifdef HAVE_DTWIDTHTYPE_SHORT
return EnumWeekdays(locale, calendarId, DateFormatSymbols::STANDALONE, DateFormatSymbols::SHORT, callback, context);
+#else
+ // Currently CentOS-7 uses ICU-50 and ::SHORT was added in ICU-51, so use ::NARROW instead
+ return EnumWeekdays(locale, calendarId, DateFormatSymbols::STANDALONE, DateFormatSymbols::NARROW, callback, context);
+#endif
case MonthGenitiveNames:
return EnumMonths(locale, calendarId, DateFormatSymbols::FORMAT, DateFormatSymbols::WIDE, callback, context);
case AbbrevMonthGenitiveNames: