From dceedfb915fed8da7be0a76e56cc8722ac26b312 Mon Sep 17 00:00:00 2001 From: theraven Date: Sat, 25 Aug 2012 12:31:41 +0000 Subject: [PATCH] Fix the build on platforms without tiny string support. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35447 72102866-910b-0410-8b05-ffd578937521 --- Source/GSString.m | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/GSString.m b/Source/GSString.m index d1afd8ac7..e242c3e90 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -867,6 +867,12 @@ createTinyString(const char *str, int length) __sync_fetch_and_add(&tinyStrings, 1); return (id)s; } +#else +static id +createTinyString(const char *str, int length) +{ + return nil; +} #endif /* * The GSPlaceholderString class is used by the abstract cluster root @@ -3740,7 +3746,7 @@ agree, create a new GSCInlineString otherwise. - (NSString*) substringFromRange: (NSRange)aRange { - if (useTinyStrings && !_flags.wide) + if (!_flags.wide) { id tinyString = createTinyString((char*)_contents.c + aRange.location, aRange.length); @@ -3764,7 +3770,7 @@ agree, create a new GSCInlineString otherwise. GS_RANGE_CHECK(aRange, _count); return substring_c((GSStr)self, aRange); } - if (useTinyStrings && !_flags.wide) + if (!_flags.wide) { id tinyString = createTinyString((char*)_contents.c + aRange.location, aRange.length); @@ -4075,7 +4081,7 @@ agree, create a new GSCInlineString otherwise. - (NSString*) substringFromRange: (NSRange)aRange { - if (useTinyStrings && !_flags.wide) + if (!_flags.wide) { id tinyString = createTinyString((char*)_contents.c + aRange.location, aRange.length); @@ -4094,7 +4100,7 @@ agree, create a new GSCInlineString otherwise. - (NSString*) substringWithRange: (NSRange)aRange { - if (useTinyStrings && !_flags.wide) + if (!_flags.wide) { id tinyString = createTinyString((char*)_contents.c + aRange.location, aRange.length); @@ -5107,7 +5113,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException); aRange.length * sizeof(unichar)); return o; } - else if (useTinyStrings) + else { id tinyString = createTinyString((char*)_contents.c + aRange.location, aRange.length); @@ -5142,7 +5148,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException); aRange.length * sizeof(unichar)); return o; } - else if (useTinyStrings) + else { id tinyString = createTinyString((char*)_contents.c + aRange.location, aRange.length);