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

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