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
This commit is contained in:
rfm 2010-12-17 11:45:17 +00:00
parent 99d78c80fc
commit 49abda74b2
4 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2010-12-17 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <stefanbidi@gmail.com>
* Source/NSCalendar.m: Added code for -maximumRangeOfUnit: and

View file

@ -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);
}

6
configure vendored
View file

@ -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; }

View file

@ -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)