From 2f99328775f241960cbdbfd425d2170e7f140d2d Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 11 Jul 2013 12:41:56 +0000 Subject: [PATCH] fix check for unicode normalisation git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36871 72102866-910b-0410-8b05-ffd578937521 --- Source/NSString.m | 10 ++++++---- configure | 3 ++- configure.ac | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/NSString.m b/Source/NSString.m index 9ee90d5fa..b76c39108 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -662,6 +662,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale) return NULL; } +#if defined(HAVE_UNICODE_UNORM2_H) - (NSString *) _normalizedICUStringOfType: (const char*)normalization mode: (UNormalization2Mode)mode { @@ -750,6 +751,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale) return AUTORELEASE(newString); } #endif +#endif + (void) atExit { @@ -1769,7 +1771,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale) - (NSString *) decomposedStringWithCompatibilityMapping { -#if GS_USE_ICU == 1 +#if (GS_USE_ICU == 1) && defined(HAVE_UNICODE_UNORM2_H) return [self _normalizedICUStringOfType: "nfkc" mode: UNORM2_DECOMPOSE]; #else return [self notImplemented: _cmd]; @@ -1778,7 +1780,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale) - (NSString *) decomposedStringWithCanonicalMapping { -#if GS_USE_ICU == 1 +#if (GS_USE_ICU == 1) && defined(HAVE_UNICODE_UNORM2_H) return [self _normalizedICUStringOfType: "nfc" mode: UNORM2_DECOMPOSE]; #else return [self notImplemented: _cmd]; @@ -3931,7 +3933,7 @@ static NSFileManager *fm = nil; - (NSString *) precomposedStringWithCompatibilityMapping { -#if GS_USE_ICU == 1 +#if (GS_USE_ICU == 1) && defined(HAVE_UNICODE_UNORM2_H) return [self _normalizedICUStringOfType: "nfkc" mode: UNORM2_COMPOSE]; #else return [self notImplemented: _cmd]; @@ -3940,7 +3942,7 @@ static NSFileManager *fm = nil; - (NSString *) precomposedStringWithCanonicalMapping { -#if GS_USE_ICU == 1 +#if (GS_USE_ICU == 1) && defined(HAVE_UNICODE_UNORM2_H) return [self _normalizedICUStringOfType: "nfc" mode: UNORM2_COMPOSE]; #else return [self notImplemented: _cmd]; diff --git a/configure b/configure index 82ad600e0..b9acd88c0 100755 --- a/configure +++ b/configure @@ -26090,7 +26090,8 @@ $as_echo "yes" >&6; } -for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/unorm2.h + +for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/unorm2.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then diff --git a/configure.ac b/configure.ac index 720a5d61d..e0ecd833d 100644 --- a/configure.ac +++ b/configure.ac @@ -3204,7 +3204,7 @@ if test $enable_icu = yes; then if test "$have_icu" = "yes"; then AC_MSG_RESULT(yes) - AC_CHECK_HEADERS(unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/unorm2.h) + AC_CHECK_HEADERS(unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/unorm2.h) LIBS="$LIBS $ICU_LIBS" LDFLAGS="$LDFLAGS $ICU_LDFLAGS" LDIR_FLAGS="$LDIR_FLAGS $ICU_LDFLAGS"