mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Implement versdion check for new ICU code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39424 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ec73ec0593
commit
8fe8af2d57
3 changed files with 9 additions and 5 deletions
|
@ -38,6 +38,7 @@
|
||||||
#if defined(HAVE_UNICODE_UCAL_H)
|
#if defined(HAVE_UNICODE_UCAL_H)
|
||||||
#define id ucal_id
|
#define id ucal_id
|
||||||
#include <unicode/ucal.h>
|
#include <unicode/ucal.h>
|
||||||
|
#include <unicode/uvernum.h>
|
||||||
#undef id
|
#undef id
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -396,11 +397,14 @@ do \
|
||||||
toDate: (NSDate *) resultDate
|
toDate: (NSDate *) resultDate
|
||||||
options: (NSUInteger) opts
|
options: (NSUInteger) opts
|
||||||
{
|
{
|
||||||
#if GS_USE_ICU == 1
|
#if GS_USE_ICU == 1 && (U_ICU_VERSION_MAJOR_NUM > 4 \
|
||||||
|
|| (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >= 8))
|
||||||
|
|
||||||
NSDateComponents *comps = nil;
|
NSDateComponents *comps = nil;
|
||||||
UErrorCode err = U_ZERO_ERROR;
|
UErrorCode err = U_ZERO_ERROR;
|
||||||
UDate udateFrom = (UDate)floor([startingDate timeIntervalSince1970] * 1000.0);
|
UDate udateFrom = (UDate)floor([startingDate timeIntervalSince1970] * 1000.0);
|
||||||
UDate udateTo = (UDate)floor([resultDate timeIntervalSince1970] * 1000.0);
|
UDate udateTo = (UDate)floor([resultDate timeIntervalSince1970] * 1000.0);
|
||||||
|
|
||||||
ucal_setMillis (my->cal, udateFrom, &err);
|
ucal_setMillis (my->cal, udateFrom, &err);
|
||||||
if (U_FAILURE(err))
|
if (U_FAILURE(err))
|
||||||
{
|
{
|
||||||
|
|
6
configure
vendored
6
configure
vendored
|
@ -12117,9 +12117,9 @@ fi
|
||||||
echo "See http://site.icu-project.org/ for help."
|
echo "See http://site.icu-project.org/ for help."
|
||||||
else
|
else
|
||||||
ICU_VERSION=`$ICU_CONFIG --version`
|
ICU_VERSION=`$ICU_CONFIG --version`
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU >= 4.8" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU >= 4.6" >&5
|
||||||
$as_echo_n "checking for ICU >= 4.8... " >&6; }
|
$as_echo_n "checking for ICU >= 4.6... " >&6; }
|
||||||
found=`expr $ICU_VERSION \>= 4.8`
|
found=`expr $ICU_VERSION \>= 4.6`
|
||||||
if test "$found" = "1" ; then
|
if test "$found" = "1" ; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
$as_echo "yes" >&6; }
|
$as_echo "yes" >&6; }
|
||||||
|
|
|
@ -3317,7 +3317,7 @@ AC_ARG_WITH(icu-library,
|
||||||
|
|
||||||
if test $enable_icu = yes; then
|
if test $enable_icu = yes; then
|
||||||
if test "$enable_icu_config" = "yes"; then
|
if test "$enable_icu_config" = "yes"; then
|
||||||
AC_CHECK_ICU(4.8, have_icu=yes, have_icu=no)
|
AC_CHECK_ICU(4.6, have_icu=yes, have_icu=no)
|
||||||
else
|
else
|
||||||
have_icu=no;
|
have_icu=no;
|
||||||
AC_CHECKING([for libicu (icu-config disabled)])
|
AC_CHECKING([for libicu (icu-config disabled)])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue