From 8d225f1583bcb1f9cdb46b958535af5e04b9f6f6 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 17 Dec 2010 11:45:17 +0000 Subject: [PATCH] fix to build with older ICU git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31746 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSCalendar.m | 9 ++++++++- configure | 6 +++--- configure.ac | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e2e778a9..25173313f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-17 Richard Frith-Macdonald + + * Source/NSCalendar.m: Fix to build with ICU 4.0 + * configure.ac: Permit ICU version as old as 4.0 + * configure: regenerate + 2010-12-16 Stefan Bidigaray * Source/NSCalendar.m: Added code for -maximumRangeOfUnit: and diff --git a/Source/NSCalendar.m b/Source/NSCalendar.m index 71d726f81..80cd75a19 100644 --- a/Source/NSCalendar.m +++ b/Source/NSCalendar.m @@ -93,7 +93,14 @@ static UCalendarDateFields _NSCalendarUnitToDateField (NSCalendarUnit unit) if (tzLen > TZ_NAME_LENGTH) tzLen = TZ_NAME_LENGTH; [tzName getCharacters: cTzId range: NSMakeRange(0, tzLen)]; - + +#ifndef UCAL_DEFAULT +/* + * Older versions of ICU used UCAL_TRADITIONAL rather than UCAL_DEFAULT + * so if one is not available we use the other. + */ +#define UCAL_DEFAULT UCAL_TRADITIONAL +#endif _cal = ucal_open ((const UChar *)cTzId, tzLen, cLocaleId, UCAL_DEFAULT, &err); } diff --git a/configure b/configure index fa7e9eebd..996300a25 100755 --- a/configure +++ b/configure @@ -23898,9 +23898,9 @@ fi echo "See http://site.icu-project.org/ for help." else ICU_VERSION=`$ICU_CONFIG --version` - { $as_echo "$as_me:$LINENO: checking for ICU >= 4.6" >&5 -$as_echo_n "checking for ICU >= 4.6... " >&6; } - found=`expr $ICU_VERSION \>= 4.6` + { $as_echo "$as_me:$LINENO: checking for ICU >= 4.0" >&5 +$as_echo_n "checking for ICU >= 4.0... " >&6; } + found=`expr $ICU_VERSION \>= 4.0` if test "$found" = "1" ; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } diff --git a/configure.ac b/configure.ac index 16dde2de1..ac92b26a3 100644 --- a/configure.ac +++ b/configure.ac @@ -2683,7 +2683,7 @@ AC_ARG_ENABLE(icu, enable_icu=yes) if test $enable_icu = yes; then - AC_CHECK_ICU(4.6, have_icu=yes, have_icu=no) + AC_CHECK_ICU(4.0, have_icu=yes, have_icu=no) if test "$have_icu" = "yes"; then AC_MSG_RESULT(yes) AC_CHECK_HEADERS(unicode/uloc.h unicode/ulocdata.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h)