mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Support for GCC 3.0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10085 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
57cf61f0a0
commit
24857a5f04
11 changed files with 691 additions and 549 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2001-06-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
Changes for constant string support with gcc-3.0
|
||||
* configure.in: Just substitute NXCONST
|
||||
* Headers/gnustep/base/GSConfig.h.in: Use NXCONST to redefine
|
||||
NXConstantString
|
||||
* Headers/gnustep/base/NSString.h: new constantStringClass method.
|
||||
* Source/GSString.m: new constantStringClass method.
|
||||
* Source/NSObject.m: Use NSConstantStringClass.
|
||||
* Source/NSScanner.m: Use NSConstantStringClass.
|
||||
* Source/NSString.m: implement constantStringClass method.
|
||||
|
||||
2001-06-06 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
* Source/mframe.m: Reactivated inling nested functions after
|
||||
|
|
|
@ -159,5 +159,10 @@ typedef @GS_ADDR@ gsaddr;
|
|||
#define GS_GC_UNHIDE(obj) ((id)obj)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define to say if we use NXConstantString or NSConstantString
|
||||
*/
|
||||
#define NXConstantString @NXCONST@
|
||||
|
||||
#endif /* included_GSConfig_h */
|
||||
|
||||
|
|
|
@ -288,6 +288,7 @@ enum {
|
|||
@end
|
||||
|
||||
@interface NSString : NSObject <NSString>
|
||||
+ (Class) constantStringClass;
|
||||
@end
|
||||
|
||||
@class NSMutableString;
|
||||
|
|
|
@ -319,7 +319,7 @@ static SEL objSel;
|
|||
{
|
||||
if (aKey == nil)
|
||||
{
|
||||
NSWarnMLog(@"attempt to remove nil key", 0);
|
||||
NSWarnMLog(@"attempt to remove nil key");
|
||||
return;
|
||||
}
|
||||
GSIMapRemoveKey(&map, (GSIMapKey)aKey);
|
||||
|
|
|
@ -204,7 +204,7 @@ static Class GSUnicodeStringClass = 0;
|
|||
static Class GSUnicodeSubStringClass = 0;
|
||||
static Class GSUnicodeInlineStringClass = 0;
|
||||
static Class GSMutableStringClass = 0;
|
||||
static Class NXConstantStringClass = 0;
|
||||
static Class NSConstantStringClass = 0;
|
||||
|
||||
static SEL convertSel;
|
||||
static BOOL (*convertImp)(id, SEL, NSStringEncoding);
|
||||
|
@ -244,7 +244,7 @@ setup()
|
|||
GSCSubStringClass = [GSCSubString class];
|
||||
GSUnicodeSubStringClass = [GSUnicodeSubString class];
|
||||
GSMutableStringClass = [GSMutableString class];
|
||||
NXConstantStringClass = [NXConstantString class];
|
||||
NSConstantStringClass = [NSString constantStringClass];
|
||||
|
||||
/*
|
||||
* Cache some selectors and method implementations for
|
||||
|
@ -393,12 +393,12 @@ setup()
|
|||
format: @"-initWithString: given non-string object"];
|
||||
|
||||
length = [string length];
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES || c == NXConstantStringClass
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES || c == NSConstantStringClass
|
||||
|| (GSObjCIsKindOf(c, GSMutableStringClass) == YES
|
||||
&& ((ivars)string)->_flags.wide == 0))
|
||||
{
|
||||
/*
|
||||
* For a GSCString subclass, and NXConstantString, or an 8-bit
|
||||
* For a GSCString subclass, and ??ConstantString, or an 8-bit
|
||||
* GSMutableString, we can copy the bytes directly into a GSCString.
|
||||
*/
|
||||
me = (ivars)NSAllocateObject(GSCInlineStringClass,
|
||||
|
@ -463,7 +463,7 @@ setup()
|
|||
* The following inline functions are used by the concrete string classes
|
||||
* to implement their core functionality.
|
||||
* GSCString uses the functions with the _c suffix.
|
||||
* GSCSubString and NXConstant inherit methods from GSCString.
|
||||
* GSCSubString and ??ConstantString inherit methods from GSCString.
|
||||
* GSUnicodeString uses the functions with the _u suffix.
|
||||
* GSUnicodeSubString inherits methods from GSUnicodeString.
|
||||
* GSMutableString uses all the functions, selecting the _c or _u versions
|
||||
|
@ -588,7 +588,7 @@ compare_c(ivars self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 1))
|
||||
return strCompCsUs((id)self, aString, mask, aRange);
|
||||
else if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NXConstantStringClass
|
||||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 0))
|
||||
return strCompCsCs((id)self, aString, mask, aRange);
|
||||
else
|
||||
|
@ -610,7 +610,7 @@ compare_u(ivars self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 1))
|
||||
return strCompUsUs((id)self, aString, mask, aRange);
|
||||
else if (GSObjCIsKindOf(c, GSCStringClass)
|
||||
|| c == NXConstantStringClass
|
||||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 0))
|
||||
return strCompUsCs((id)self, aString, mask, aRange);
|
||||
else
|
||||
|
@ -1001,7 +1001,7 @@ isEqual_c(ivars self, id anObject)
|
|||
return NO;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
if (c == NXConstantStringClass)
|
||||
if (c == NSConstantStringClass)
|
||||
{
|
||||
ivars other = (ivars)anObject;
|
||||
NSRange r = {0, self->_count};
|
||||
|
@ -1068,7 +1068,7 @@ isEqual_u(ivars self, id anObject)
|
|||
return NO;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
if (c == NXConstantStringClass)
|
||||
if (c == NSConstantStringClass)
|
||||
{
|
||||
ivars other = (ivars)anObject;
|
||||
NSRange r = {0, self->_count};
|
||||
|
@ -1292,7 +1292,7 @@ rangeOfString_c(ivars self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 1))
|
||||
return strRangeCsUs((id)self, aString, mask, aRange);
|
||||
else if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NXConstantStringClass
|
||||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 0))
|
||||
return strRangeCsCs((id)self, aString, mask, aRange);
|
||||
else
|
||||
|
@ -1314,7 +1314,7 @@ rangeOfString_u(ivars self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 1))
|
||||
return strRangeUsUs((id)self, aString, mask, aRange);
|
||||
else if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NXConstantStringClass
|
||||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((ivars)aString)->_flags.wide == 0))
|
||||
return strRangeUsCs((id)self, aString, mask, aRange);
|
||||
else
|
||||
|
@ -1390,7 +1390,7 @@ transmute(ivars self, NSString *aString)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) || c == NXConstantStringClass
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) || c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && other->_flags.wide == 0))
|
||||
{
|
||||
/*
|
||||
|
@ -2956,7 +2956,7 @@ transmute(ivars self, NSString *aString)
|
|||
c = GSObjCClass(anObject);
|
||||
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NXConstantStringClass
|
||||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((ivars)anObject)->_flags.wide == 0))
|
||||
{
|
||||
ivars other = (ivars)anObject;
|
||||
|
@ -3003,7 +3003,7 @@ transmute(ivars self, NSString *aString)
|
|||
c = GSObjCClass(anObject);
|
||||
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NXConstantStringClass
|
||||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((ivars)anObject)->_flags.wide == 0))
|
||||
{
|
||||
ivars other = (ivars)anObject;
|
||||
|
|
|
@ -48,7 +48,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
static Class fastMallocClass;
|
||||
static unsigned fastMallocOffset;
|
||||
|
||||
static Class NXConstantStringClass;
|
||||
static Class NSConstantStringClass;
|
||||
|
||||
@class NSDataMalloc;
|
||||
@class NSMutableDataMalloc;
|
||||
|
@ -407,7 +407,7 @@ NSDeallocateObject(NSObject *anObject)
|
|||
inline NSZone *
|
||||
GSObjCZone(NSObject *object)
|
||||
{
|
||||
if (GSObjCClass(object) == NXConstantStringClass)
|
||||
if (GSObjCClass(object) == NSConstantStringClass)
|
||||
return NSDefaultMallocZone();
|
||||
return ((obj)object)[-1].zone;
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ GSObjCZone(NSObject *object)
|
|||
inline NSZone *
|
||||
GSObjCZone(NSObject *object)
|
||||
{
|
||||
if (GSObjCClass(object) == NXConstantStringClass)
|
||||
if (GSObjCClass(object) == NSConstantStringClass)
|
||||
return NSDefaultMallocZone();
|
||||
return NSZoneFromPointer(&((obj)object)[-1]);
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ NSDeallocateObject(NSObject *anObject)
|
|||
inline NSZone *
|
||||
GSObjCZone(NSObject *object)
|
||||
{
|
||||
if (GSObjCClass(object) == NXConstantStringClass)
|
||||
if (GSObjCClass(object) == NSConstantStringClass)
|
||||
return NSDefaultMallocZone();
|
||||
return NSZoneFromPointer(object);
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ static BOOL double_release_check_enabled = NO;
|
|||
#else
|
||||
fastMallocOffset = 0;
|
||||
#endif
|
||||
NXConstantStringClass = [NXConstantString class];
|
||||
NSConstantStringClass = [NSString constantStringClass];
|
||||
GSBuildStrings();
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
|
|
|
@ -44,7 +44,7 @@ static Class GSCStringClass;
|
|||
static Class GSUnicodeStringClass;
|
||||
static Class GSMutableStringClass;
|
||||
static Class GSPlaceholderStringClass;
|
||||
static Class NXConstantStringClass;
|
||||
static Class NSConstantStringClass;
|
||||
static NSCharacterSet *defaultSkipSet;
|
||||
static SEL memSel;
|
||||
|
||||
|
@ -84,7 +84,7 @@ typedef struct {
|
|||
GSUnicodeStringClass = [GSUnicodeString class];
|
||||
GSMutableStringClass = [GSMutableString class];
|
||||
GSPlaceholderStringClass = [GSPlaceholderString class];
|
||||
NXConstantStringClass = [NXConstantString class];
|
||||
NSConstantStringClass = [NSString constantStringClass];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ typedef struct {
|
|||
length: ((ivars)aString)->_count];
|
||||
}
|
||||
}
|
||||
else if (c == NXConstantStringClass)
|
||||
else if (c == NSConstantStringClass)
|
||||
{
|
||||
_isUnicode = NO;
|
||||
_string = RETAIN(aString);
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
static Class NSDataClass;
|
||||
static Class NSStringClass;
|
||||
static Class NSMutableStringClass;
|
||||
static Class NSConstantStringClass;
|
||||
|
||||
static Class GSStringClass;
|
||||
static Class GSMutableStringClass;
|
||||
|
@ -338,6 +339,7 @@ handle_printf_atsign (FILE *stream,
|
|||
NSStringClass = self;
|
||||
[self setVersion: 1];
|
||||
NSMutableStringClass = [NSMutableString class];
|
||||
NSConstantStringClass = [NXConstantString class];
|
||||
NSDataClass = [NSData class];
|
||||
GSPlaceholderStringClass = [GSPlaceholderString class];
|
||||
GSStringClass = [GSString class];
|
||||
|
@ -423,6 +425,11 @@ handle_printf_atsign (FILE *stream,
|
|||
}
|
||||
}
|
||||
|
||||
+ (Class) constantStringClass
|
||||
{
|
||||
return NSConstantStringClass;
|
||||
}
|
||||
|
||||
// Creating Temporary Strings
|
||||
|
||||
+ (id) string
|
||||
|
|
|
@ -296,7 +296,7 @@ NSString *NSClassDescriptionNeededForClassNotification;
|
|||
|
||||
/*
|
||||
* Setup function called when NSString is initialised.
|
||||
* We make all the constant strings not be NXConstantString so they can
|
||||
* We make all the constant strings not be constant strings so they can
|
||||
* cache their hash values and be used much more efficiently as keys in
|
||||
* dictionaries etc.
|
||||
*/
|
||||
|
|
|
@ -891,6 +891,12 @@ AC_SUBST(MINOR_VERSION)
|
|||
AC_SUBST(SUBMINOR_VERSION)
|
||||
AC_SUBST(GCC_VERSION)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Set the constant string class support.
|
||||
#--------------------------------------------------------------------
|
||||
NXCONST=NXConstantString
|
||||
AC_SUBST(NXCONST)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Write the Makefiles
|
||||
#--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue