From: helge Date: Fri, 14 Jul 2006 13:06:21 +0000 (+0000) Subject: merged libFoundation 1.1.3 into SOPE trunk X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4913fa7a5bb6d60f3efe6e2a9c040b111bdf54fb;p=sope merged libFoundation 1.1.3 into SOPE trunk git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1319 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/libFoundation/ChangeLog b/libFoundation/ChangeLog index f49f1224..245b357b 100644 --- a/libFoundation/ChangeLog +++ b/libFoundation/ChangeLog @@ -1,3 +1,112 @@ +2006-07-14 Frank Reppin + + * added RPM and Debian build specifications (v1.1.3) + +2006-07-10 Helge Hess + + * Foundation/GNUmakefile: include libFoundation.make after common.make + to properly load OBJCFLAGS (fixes another issue with + NSConstantString) (v1.1.2) + +2006-07-07 Helge Hess + + * examples/GNUmakefile: properly include libFoundation.make (v1.1.1) + +2006-07-04 Helge Hess + + * v1.1.0 + + * Foundation/libFoundation.make.in: properly specify + -fconstant-string-class=NSConstantString to activate the new + constant NSString class + + * Foundation/NSConcreteString.m: activated NSConstantString, + deactivated NXConstantString, this requires GCC 3 plus a matching + runtime (libobjc.1), it obsoletes the lF specific libobjc.lf + +2006-07-03 Helge Hess + + * v1.0.86 + + * makefiles: lookup/install libraries in lib64 when compiling with a + 64bit target CPU + + * work on 64bit port. Use %p instead of %08X, use long instead + of int, etc + + * fixed plenty of gcc 4.1 warnings (missing dealloc, conditional + types) + +2006-06-22 Frank Reppin + + * config/i386/openbsd3.9.h <- adjust for 3_9 + +2006-06-16 Helge Hess + + * added i386/OpenBSD 3.9 config file (v1.0.85) + +2005-12-05 Helge Hess + + * v1.0.84 + + * Foundation/NSConcreteCharacterSet.m: added a -description to bitmap + character set. Fixed OGo bug #1594 (checking a bitmap charsets + always returned true, probably due to some gcc4 issue). Uses + 'unsigned char' in bitmap macros. + + * Foundation/NSValue.h, NSConcreteNumber.m.sh, NSConcreteNumber.m, + NSDecimalNumber.m: explicitly use 'signed char' in -charValue + method + + * Foundation/NSConcreteMutableString.m, NSCharacterSet.m: minor code + cleanups + +2005-11-20 Helge Hess + + * config.guess/config.sub: updated to files from gstep-make 1.11.0 + (v1.0.83) + + * added x86_64 config files based on the i386 ones (v1.0.82) + +2005-08-28 Helge Hess + + * v1.0.81 + + * Foundation/NSNotificationCenter.m: do not use NSZone to avoid an + NSString issue with the gcc libobjc + + * examples/Defaults.m (read_command): fixed gcc4 warnings + +2005-10-04 Sebastian Ley + + * config/powerpc64/linux.h: poperly include powerpc64.h instead of + i386.h, fixes bug #1559 (v1.0.80) + +2005-09-26 Helge Hess + + * v1.0.79 + + * aclocal.m4: include stdlib.h to avoid a gcc4 warning + + * *GNUmakefile: prefer GNUSTEP_MAKEFILES over GNUSTEP_SYSTEM_ROOT + + * configure.in: use GNUSTEP_MAKEFILES to locate build environment + instead of GNUSTEP_SYSTEM_ROOT + +2005-08-29 Helge Hess + + * Foundation/GNUmakefile: properly set SYSTEM_LIB_DIR so that a correct + libobjc can be found, link against -lm (v1.0.78) + +2005-08-28 Helge Hess + + * Foundation: removed plenty of gcc4 warnings (v1.0.77) + +2005-07-15 Helge Hess + + * Foundation/NSValue.h: added NSCopying / NSCoding to @interface as per + Panther documentation (v1.0.76) + 2005-06-02 Helge Hess * Foundation/NSURL.m: added +fileURLWithPath: (v1.0.75) diff --git a/libFoundation/Foundation/FFCallInvocation.m b/libFoundation/Foundation/FFCallInvocation.m index 15772995..e066c749 100644 --- a/libFoundation/Foundation/FFCallInvocation.m +++ b/libFoundation/Foundation/FFCallInvocation.m @@ -469,7 +469,7 @@ static inline void _getRetVal(FFCallInvocation *self, SEL _cmd, void *_value) - (NSString *)description { char buf[1024]; - sprintf(buf, "<%s[0x%08X]: target=0x%08X selector=%s sig=%s>", + sprintf(buf, "<%s[0x%p]: target=0x%p selector=%s sig=%s>", class_get_class_name([self class]), (unsigned)self, (unsigned)self->target, sel_get_name(self->selector), self->types); diff --git a/libFoundation/Foundation/GCDictionary.m b/libFoundation/Foundation/GCDictionary.m index 22d10e06..59830c2c 100644 --- a/libFoundation/Foundation/GCDictionary.m +++ b/libFoundation/Foundation/GCDictionary.m @@ -200,7 +200,8 @@ static const NSMapTableValueCallBacks GCOwnedStructValueCallBacks = { - (NSEnumerator *)keyEnumerator { - return AUTORELEASE([[_GCDictionaryKeyEnumerator alloc] + return AUTORELEASE([(_GCDictionaryKeyEnumerator *) + [_GCDictionaryKeyEnumerator alloc] initWithDictionary:self]); } @@ -224,10 +225,10 @@ static const NSMapTableValueCallBacks GCOwnedStructValueCallBacks = { else return [[GCDictionary alloc] initWithDictionary:self copyItems:YES]; } -- (id)mutableCopyWithZone:(NSZone*)zone +- (id)mutableCopyWithZone:(NSZone *)zone { - return [[GCMutableDictionary allocWithZone:zone] - initWithDictionary:self]; + return [(GCMutableDictionary *)[GCMutableDictionary allocWithZone:zone] + initWithDictionary:self]; } /* Private */ @@ -306,17 +307,18 @@ static const NSMapTableValueCallBacks GCOwnedStructValueCallBacks = { - (id)copyWithZone:(NSZone*)zone { - return [[GCDictionary allocWithZone:zone] initWithDictionary:self]; + return [(GCDictionary *)[GCDictionary allocWithZone:zone] + initWithDictionary:self]; } - (void)setObject:(id)anObject forKey:(id)aKey { - GCObjectCollectable *keyStruct = Malloc(sizeof(GCObjectCollectable)); + GCObjectCollectable *keyStruct = Malloc(sizeof(GCObjectCollectable)); GCObjectCollectable *valueStruct = Malloc(sizeof(GCObjectCollectable)); - - keyStruct->object = aKey; - keyStruct->isGarbageCollectable = [aKey isGarbageCollectable]; - valueStruct->object = anObject; + + keyStruct->object = aKey; + keyStruct->isGarbageCollectable = [aKey isGarbageCollectable]; + valueStruct->object = anObject; valueStruct->isGarbageCollectable = [anObject isGarbageCollectable]; NSMapInsert(table, keyStruct, valueStruct); } @@ -338,10 +340,10 @@ static const NSMapTableValueCallBacks GCOwnedStructValueCallBacks = { } @end /* GCMutableDictionary */ + /* Local Variables: c-basic-offset: 4 tab-width: 8 End: */ - diff --git a/libFoundation/Foundation/GNUmakefile b/libFoundation/Foundation/GNUmakefile index 437a9f72..2edcbe70 100644 --- a/libFoundation/Foundation/GNUmakefile +++ b/libFoundation/Foundation/GNUmakefile @@ -25,9 +25,9 @@ -include ../gsfix.make -ifeq ($(GNUSTEP_SYSTEM_ROOT),) +ifeq ($(GNUSTEP_MAKEFILES),) -$(warning ERROR: Your $(GNUSTEP_SYSTEM_ROOT) environment variable is empty !) +$(warning ERROR: Your $(GNUSTEP_MAKEFILES) environment variable is empty !) $(error Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh") else @@ -37,8 +37,9 @@ OBJC_RUNTIME=GNU GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) -include libFoundation.make +#include libFoundation.make include $(GNUSTEP_MAKEFILES)/common.make +-include libFoundation.make # not available in make distclean -include $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(OBJC_RUNTIME)/config.mak include ../Version @@ -63,11 +64,8 @@ endif LIBRARY_NAME = libFoundation libFoundation_DLL_DEF = libFoundation.def -ifeq ($(GNUSTEP_TARGET_OS),mingw32) -libFoundation_LIBRARIES_DEPEND_UPON += -lobjc -endif + ifeq ($(GNUSTEP_TARGET_OS),cygwin32) -libFoundation_LIBRARIES_DEPEND_UPON += -lobjc ADDITIONAL_CPPFLAGS += -DWIN=1 -D__WIN32__=1 endif @@ -209,16 +207,27 @@ libFoundation_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION) # add the proper dynamic linking library, not being defined in current # gstep-make versions +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += \ + -L$(FHS_INSTALL_ROOT)/lib64 \ + -L/usr/local/lib64 \ + -L/usr/lib64 +else +SYSTEM_LIB_DIR += -L$(FHS_INSTALL_ROOT)/lib -L/usr/local/lib -L/usr/lib +endif + +libFoundation_LIBRARIES_DEPEND_UPON += -lobjc + ifeq ($(GNUSTEP_TARGET_OS),linux-gnu) - libFoundation_LIBRARIES_DEPEND_UPON += -ldl + libFoundation_LIBRARIES_DEPEND_UPON += -lm -ldl endif ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris) - libFoundation_LIBARIES_DEPEND_UPON += -ldl + libFoundation_LIBARIES_DEPEND_UPON += -lm -ldl endif ifeq ($(findstring sysv4.2, $(GNUSTEP_TARGET_OS)), sysv4.2) - libFoundation_LIBRARIES_DEPEND_UPON += -ldl + libFoundation_LIBRARIES_DEPEND_UPON += -lm -ldl endif include $(GNUSTEP_MAKEFILES)/library.make diff --git a/libFoundation/Foundation/GarbageCollector.m b/libFoundation/Foundation/GarbageCollector.m index dd8dd582..a0099887 100644 --- a/libFoundation/Foundation/GarbageCollector.m +++ b/libFoundation/Foundation/GarbageCollector.m @@ -55,6 +55,7 @@ extern Class __freedObjectClass; @end @implementation __DummyGCObject + + allocWithZone:(NSZone*)zone { return NSAllocateObject(self, 0, zone); @@ -62,8 +63,12 @@ extern Class __freedObjectClass; - (void)dealloc { + /* this is to please gcc 4.1 which otherwise issues a warning (and we + don't know the -W option to disable it, let me know if you do ;-)*/ + if (0) [super dealloc]; } -@end + +@end /* __DummyGCObject */ /* The GCDoubleLinkedList is a double linked list which contains as diff --git a/libFoundation/Foundation/NSArchiver.m b/libFoundation/Foundation/NSArchiver.m index 87f7dba8..51e04c50 100644 --- a/libFoundation/Foundation/NSArchiver.m +++ b/libFoundation/Foundation/NSArchiver.m @@ -187,19 +187,19 @@ FINAL int _archiveIdOfObject(NSArchiver *self, id _object) { if (_object == nil) return 0; -#if 1 +#if 0 /* this does not work with 64bit */ else return (int)_object; #else else { int archiveId; - archiveId = (int)NSMapGet(self->outKeys, _object); + archiveId = (long)NSMapGet(self->outKeys, _object); if (archiveId == 0) { archiveId = self->archiveAddress; - NSMapInsert(self->outKeys, _object, (void*)archiveId); + NSMapInsert(self->outKeys, _object, (void*)(long)archiveId); #if ARCHIVE_DEBUGGING - NSLog(@"mapped 0x%08X => %i", _object, archiveId); + NSLog(@"mapped 0x%p => %i", _object, archiveId); #endif self->archiveAddress++; } @@ -364,7 +364,7 @@ FINAL void _writeObjC(NSArchiver *self, const void *_value, const char *_type); if (_object == nil) // don't trace nil objects .. return; - //NSLog(@"lookup 0x%08X in outObjs=0x%08X", _object, self->outObjects); + //NSLog(@"lookup 0x%p in outObjs=0x%p", _object, self->outObjects); if (NSHashGet(self->outObjects, _object) == nil) { //NSLog(@"lookup failed, object wasn't traced yet !"); @@ -431,7 +431,7 @@ FINAL void _writeObjC(NSArchiver *self, const void *_value, const char *_type); class_get_class_name(_object), [_object version]); } else { - NGLogT(@"encoder", @"encoding object 0x%08X<%s> ..", + NGLogT(@"encoder", @"encoding object 0x%p<%s> ..", _object, class_get_class_name(*(Class *)_object)); } */ @@ -440,19 +440,19 @@ FINAL void _writeObjC(NSArchiver *self, const void *_value, const char *_type); _writeInt(self, archiveId); if (tag == _C_CLASS) { // a class object - NSString *className; - unsigned len; - unsigned char *buf; + NSString *className; + unsigned len; + char *buf; className = NSStringFromClass(_object); className = [self classNameEncodedForTrueClassName:className]; len = [className cStringLength]; - buf = malloc(len + 1); + buf = malloc(len + 4); [className getCString:buf]; buf[len] = '\0'; _writeCString(self, buf); _writeInt(self, [_object version]); - free(buf); + if (buf) free(buf); } else { Class archiveClass = Nil; @@ -489,12 +489,12 @@ FINAL void _writeObjC(NSArchiver *self, const void *_value, const char *_type); - (void)_traceValueOfObjCType:(const char *)_type at:(const void *)_value { - //NSLog(@"_tracing value at 0x%08X of type %s", _value, _type); + //NSLog(@"_tracing value at 0x%p of type %s", _value, _type); switch (*_type) { case _C_ID: case _C_CLASS: - //NSLog(@"_traceObject 0x%08X", *(id *)_value); + //NSLog(@"_traceObject 0x%p", *(id *)_value); [self _traceObject:*(id *)_value]; break; @@ -618,7 +618,7 @@ FINAL void _writeObjC(NSArchiver *self, const void *_value, const char *_type); at:(const void *)_value { if (self->traceMode) { - //NSLog(@"trace value at 0x%08X of type %s", _value, _type); + //NSLog(@"trace value at 0x%p of type %s", _value, _type); [self _traceValueOfObjCType:_type at:_value]; } else { @@ -989,9 +989,9 @@ FINAL void _readObjC(NSUnarchiver *self, void *_value, const char *_type); if (_isReference) { NSAssert(archiveId, @"archive id is 0 !"); - result = (Class)NSMapGet(self->inClasses, (void *)archiveId); + result = (Class)NSMapGet(self->inClasses, (void *)(long)archiveId); if (result == nil) - result = (id)NSMapGet(self->inObjects, (void *)archiveId); + result = (id)NSMapGet(self->inObjects, (void *)(long)archiveId); if (result == nil) { [NSException raise:NSInconsistentArchiveException format:@"did not find referenced class %i.", archiveId]; @@ -1041,9 +1041,9 @@ FINAL void _readObjC(NSUnarchiver *self, void *_value, const char *_type); format:@"class versions do not match."]; } - NSMapInsert(self->inClasses, (void *)archiveId, result); + NSMapInsert(self->inClasses, (void *)(long)archiveId, result); #if ARCHIVE_DEBUGGING - NSLog(@"read class %i => 0x%08X", archiveId, result); + NSLog(@"read class %i => 0x%p", archiveId, result); #endif } @@ -1064,13 +1064,14 @@ FINAL void _readObjC(NSUnarchiver *self, void *_value, const char *_type); if (_isReference) { NSAssert(archiveId, @"archive id is 0 !"); - result = (id)NSMapGet(self->inObjects, (void *)archiveId); + result = (id)NSMapGet(self->inObjects, (void *)(long)archiveId); if (result == nil) - result = (id)NSMapGet(self->inClasses, (void *)archiveId); + result = (id)NSMapGet(self->inClasses, (void *)(long)archiveId); if (result == nil) { [NSException raise:NSInconsistentArchiveException - format:@"did not find referenced object %i.", archiveId]; + format:@"did not find referenced object %i.", + archiveId]; } result = RETAIN(result); } @@ -1083,25 +1084,25 @@ FINAL void _readObjC(NSUnarchiver *self, void *_value, const char *_type); NSAssert(class, @"could not decode class for object."); result = [class allocWithZone:self->objectZone]; - NSMapInsert(self->inObjects, (void *)archiveId, result); + NSMapInsert(self->inObjects, (void *)(long)archiveId, result); #if ARCHIVE_DEBUGGING - NSLog(@"read object %i => 0x%08X", archiveId, result); + NSLog(@"read object %i => 0x%p", archiveId, result); #endif replacement = [result initWithCoder:self]; if (replacement != result) { /* NGLogT(@"decoder", - @"object 0x%08X<%s> replaced by 0x%08X<%s> in initWithCoder:", + @"object 0x%p<%s> replaced by 0x%p<%s> in initWithCoder:", result, class_get_class_name(*(Class *)result), replacement, class_get_class_name(*(Class *)replacement)); */ replacement = RETAIN(replacement); - NSMapRemove(self->inObjects, (void*)archiveId); + NSMapRemove(self->inObjects, (void *)(long)archiveId); result = replacement; - NSMapInsert(self->inObjects, (void *)archiveId, result); + NSMapInsert(self->inObjects, (void *)(long)archiveId, result); RELEASE(replacement); } @@ -1109,19 +1110,19 @@ FINAL void _readObjC(NSUnarchiver *self, void *_value, const char *_type); if (replacement != result) { /* NGLogT(@"decoder", - @"object 0x%08X<%s> replaced by 0x%08X<%s> in awakeAfterUsingCoder:", + @"object 0x%p<%s> replaced by 0x%p<%s> in awakeAfterUsingCoder:", result, class_get_class_name(*(Class *)class), replacement, class_get_class_name(*(Class *)replacement)); */ replacement = RETAIN(replacement); - NSMapRemove(self->inObjects, (void*)archiveId); + NSMapRemove(self->inObjects, (void *)(long)archiveId); result = replacement; - NSMapInsert(self->inObjects, (void *)archiveId, result); + NSMapInsert(self->inObjects, (void *)(long)archiveId, result); RELEASE(replacement); } - //NGLogT(@"decoder", @"decoded object 0x%08X<%@>", + //NGLogT(@"decoder", @"decoded object 0x%p<%@>", // (unsigned)result, NSStringFromClass([result class])); } diff --git a/libFoundation/Foundation/NSArray.m b/libFoundation/Foundation/NSArray.m index a53114c4..dba927d1 100644 --- a/libFoundation/Foundation/NSArray.m +++ b/libFoundation/Foundation/NSArray.m @@ -70,7 +70,7 @@ static Class NSConcreteArrayClass = Nil; NSConcreteArrayClass = [NSConcreteArray class]; return NSAllocateObject( (self == NSArrayClass) ? - NSConcreteArrayClass : self, 0, zone); + NSConcreteArrayClass : (Class)self, 0, zone); } + (id)array @@ -852,7 +852,8 @@ static int compare(id elem1, id elem2, void* comparator) NSConcreteMutableArrayClass = [NSConcreteMutableArray class]; return NSAllocateObject( (self == NSMutableArrayClass) ? - NSConcreteMutableArrayClass : self, 0, zone); + NSConcreteMutableArrayClass : (Class)self, + 0, zone); } + (id)arrayWithCapacity:(unsigned int)aNumItems diff --git a/libFoundation/Foundation/NSAutoreleasePool.m b/libFoundation/Foundation/NSAutoreleasePool.m index 9d9d4370..f5d02874 100644 --- a/libFoundation/Foundation/NSAutoreleasePool.m +++ b/libFoundation/Foundation/NSAutoreleasePool.m @@ -131,7 +131,7 @@ BOOL __autoreleaseEnableWarning = YES; if (pool != self) { #if LOG_RELEASE_COUNT - NSLog(@"auto release child pool 0x%08X ..", pool); + NSLog(@"auto release child pool 0x%p ..", pool); #endif RELEASE(pool); continue; @@ -176,8 +176,8 @@ BOOL __autoreleaseEnableWarning = YES; ch->objects[i] = NULL; #if LOG_RELEASE - fprintf(fh, "%-30s 0x%08X %2i - ", - oc->name, (unsigned)obj, [obj retainCount]); + fprintf(fh, "%-30s 0x%p %2i - ", + oc->name, obj, [obj retainCount]); #endif if (lastClass != oc) { @@ -310,10 +310,10 @@ inline void NSAutoreleasePool_AutoreleaseObject(id aObject) NSAutoreleasePool_AddObject(pool, aObject); else { fprintf(stderr, - "called -autorelease on object 0x%08X<%s> with no " + "called -autorelease on object 0x%p<%s> with no " "autorelease pool in place, " "will leak that memory !\n", - (unsigned int)aObject, + aObject, (*(struct objc_class **)aObject)->name); } } diff --git a/libFoundation/Foundation/NSBundle.m b/libFoundation/Foundation/NSBundle.m index 10fc9a13..f12e739d 100644 --- a/libFoundation/Foundation/NSBundle.m +++ b/libFoundation/Foundation/NSBundle.m @@ -308,7 +308,7 @@ static void load_callback(Class class, Category* category) isFlattened = [NSBundle isFlattenedDirLayout]; environment = useGNUstepEnv ? [[NSProcessInfo processInfo] environment] - : nil; + : (NSDictionary *)nil; fm = [NSFileManager defaultManager]; diff --git a/libFoundation/Foundation/NSCalendarDate.m b/libFoundation/Foundation/NSCalendarDate.m index 2d4c5f54..fa528dea 100644 --- a/libFoundation/Foundation/NSCalendarDate.m +++ b/libFoundation/Foundation/NSCalendarDate.m @@ -173,7 +173,7 @@ static NSDictionary* defaultLocaleDictionary = nil; return (unsigned)self->timeSinceRef; } -- (NSComparisonResult)compare:(NSDate *)other +- (NSComparisonResult)compare:(id)other { if ([other isKindOfClass:[NSDate class]]) { NSTimeInterval diff diff --git a/libFoundation/Foundation/NSCharacterSet.m b/libFoundation/Foundation/NSCharacterSet.m index ddd219c4..4475d7a7 100644 --- a/libFoundation/Foundation/NSCharacterSet.m +++ b/libFoundation/Foundation/NSCharacterSet.m @@ -43,7 +43,8 @@ + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject( (self == [NSCharacterSet class]) ? - [NSBitmapCharacterSet class] : self, 0, zone); + [NSBitmapCharacterSet class] : (Class)self, + 0, zone); } // Creating a shared Character Set from a standard file @@ -100,9 +101,9 @@ extern NSRecursiveLock* libFoundationLock; if (aSet == nil) { fprintf(stderr, "ERROR(%s): could not create character set for " - "data (0x%08X,len=%d) from file %s (%s)\n", + "data (0x%p,len=%d) from file %s (%s)\n", __PRETTY_FUNCTION__, - (unsigned int)data, [data length], [fileName cString], + data, [data length], [fileName cString], [fullFilenamePath cString]); } @@ -189,25 +190,28 @@ extern NSRecursiveLock* libFoundationLock; initWithBitmapRepresentation:data]); } -+ (NSCharacterSet*)characterSetWithCharactersInString:(NSString*)aString ++ (NSCharacterSet*)characterSetWithCharactersInString:(NSString *)aString { - char* bytes = CallocAtomic(1, BITMAPDATABYTES); - id data; - int i, count = [aString length]; - unichar c; + unsigned char *bytes = CallocAtomic(1, BITMAPDATABYTES); + id data; + unsigned int i, count; - for (i = 0; i < count; i++) { + for (i = 0, count = [aString length]; i < count; i++) { + register unichar c; + c = [aString characterAtIndex:i]; SETBIT(bytes, c); } - - data = [NSData dataWithBytesNoCopy:bytes - length:BITMAPDATABYTES]; - return [self isKindOfClass:[NSMutableCharacterSet class]] + + data = [[NSData alloc] initWithBytesNoCopy:bytes + length:BITMAPDATABYTES]; + self = [self isKindOfClass:[NSMutableCharacterSet class]] ? AUTORELEASE([[NSMutableBitmapCharacterSet alloc] initWithBitmapRepresentation:data]) : AUTORELEASE([[NSBitmapCharacterSet alloc] initWithBitmapRepresentation:data]); + [data release]; + return self; } + (NSCharacterSet*)characterSetWithRange:(NSRange)aRange @@ -297,8 +301,9 @@ extern NSRecursiveLock* libFoundationLock; + (id)allocWithZone:(NSZone*)zone { - return NSAllocateObject( (self == [NSMutableCharacterSet class]) ? - [NSMutableBitmapCharacterSet class] : self, 0, zone); + return NSAllocateObject( (self == [NSMutableCharacterSet class]) + ? [NSMutableBitmapCharacterSet class] + : (Class)self, 0, zone); } // Creating a Custom Character Set @@ -308,12 +313,12 @@ extern NSRecursiveLock* libFoundationLock; return AUTORELEASE([[self alloc] initWithBitmapRepresentation:data]); } -+ (NSCharacterSet*)characterSetWithContentsOfFile:(NSString*)fileName ++ (NSCharacterSet *)characterSetWithContentsOfFile:(NSString *)fileName { NSCharacterSet *set = [super characterSetWithContentsOfFile:fileName]; return AUTORELEASE([set mutableCopy]); } -+ (NSCharacterSet*)characterSetWithCharactersInString:(NSString*)aString ++ (NSCharacterSet *)characterSetWithCharactersInString:(NSString *)aString { NSCharacterSet *set = [super characterSetWithCharactersInString:aString]; return AUTORELEASE([set mutableCopy]); diff --git a/libFoundation/Foundation/NSConcreteCharacterSet.h b/libFoundation/Foundation/NSConcreteCharacterSet.h index e854ab0b..8bced6ae 100644 --- a/libFoundation/Foundation/NSConcreteCharacterSet.h +++ b/libFoundation/Foundation/NSConcreteCharacterSet.h @@ -26,9 +26,9 @@ #define __NSConcreteCharacterSet_h__ #define BITMAPDATABYTES 8192*sizeof(char) -#define ISBITSET(v,n) ((((char*)v)[n/8] & (1<<(n%8))) ? YES : NO) -#define SETBIT(v,n) (((char*)v)[n/8] |= (1<<(n%8))) -#define RESETBIT(v,n) (((char*)v)[n/8] &= ~(1<<(n%8))) +#define ISBITSET(v,n) ((((unsigned char*)v)[n/8] & (1<<(n%8))) ? YES : NO) +#define SETBIT(v,n) (((unsigned char*)v)[n/8] |= (1<<(n%8))) +#define RESETBIT(v,n) (((unsigned char*)v)[n/8] &= ~(1<<(n%8))) @interface NSRangeCharacterSet : NSCharacterSet { @@ -56,15 +56,18 @@ @interface NSBitmapCharacterSet : NSCharacterSet { - id data; - char* bytes; - BOOL inverted; + id data; + char *bytes; + BOOL inverted; } -- initWithBitmapRepresentation:(id)data; -- initWithBitmapRepresentation:(id)data inverted:(BOOL)inv; + +- (id)initWithBitmapRepresentation:(id)data; +- (id)initWithBitmapRepresentation:(id)data inverted:(BOOL)inv; + - (NSData *)bitmapRepresentation; - (BOOL)characterIsMember:(unichar)aCharacter; - (NSCharacterSet *)invertedSet; + @end /* NSBitmapCharacterSet */ @interface NSMutableBitmapCharacterSet : NSMutableCharacterSet diff --git a/libFoundation/Foundation/NSConcreteCharacterSet.m b/libFoundation/Foundation/NSConcreteCharacterSet.m index 68af5f1e..4ea7b557 100644 --- a/libFoundation/Foundation/NSConcreteCharacterSet.m +++ b/libFoundation/Foundation/NSConcreteCharacterSet.m @@ -178,24 +178,24 @@ @implementation NSBitmapCharacterSet -- init +- (id)init { return [self initWithBitmapRepresentation: [[NSCharacterSet emptyCharacterSet] bitmapRepresentation] inverted:NO]; } -- initWithBitmapRepresentation:(id)aData +- (id)initWithBitmapRepresentation:(id)aData { return [self initWithBitmapRepresentation:aData inverted:NO]; } -- initWithBitmapRepresentation:(id)aData inverted:(BOOL)inv +- (id)initWithBitmapRepresentation:(id)aData inverted:(BOOL)inv { [super init]; - data = [aData copy]; - bytes = (char*)[data bytes]; - inverted = inv; + self->data = [aData copy]; + self->bytes = (char *)[data bytes]; + self->inverted = inv; return self; } @@ -207,7 +207,7 @@ - (NSData *)bitmapRepresentation { - if (inverted) { + if (self->inverted) { char* theBytes = CallocAtomic(1, BITMAPDATABYTES); unsigned i; @@ -221,19 +221,28 @@ - (BOOL)characterIsMember:(unichar)aCharacter { - return inverted ^ ISBITSET(bytes, aCharacter); +#if 1 /* see OGo bug #1594 */ + if (self->inverted) { + return ISBITSET(self->bytes, aCharacter) ? NO : YES; + } + else { + return ISBITSET(self->bytes, aCharacter); + } +#else /* this is the original code, but it doesn't work (with gcc4?!) */ + return self->inverted ^ ISBITSET(self->bytes, aCharacter); +#endif } - (NSCharacterSet *)invertedSet { return AUTORELEASE([[NSBitmapCharacterSet alloc] - initWithBitmapRepresentation:data - inverted:!inverted]); + initWithBitmapRepresentation:self->data + inverted:!self->inverted]); } // NSCopying -- copyWithZone:(NSZone*)zone +- (id)copyWithZone:(NSZone *)zone { if ([self zone] == zone) return RETAIN(self); @@ -244,6 +253,29 @@ } } +/* description */ + +- (NSString *)description +{ + NSMutableString *ms; + unsigned int i; + + ms = [NSMutableString stringWithCapacity:128]; + [ms appendFormat:@"<0x%p[%@]: chars-in-latin1-range:", + self, NSStringFromClass([self class])]; + + for (i = 0; i < 256; i++) { + if (ISBITSET(bytes, i)) + [ms appendFormat:@" %i", i]; + } + + if (self->inverted) + [ms appendString:@" inverted"]; + + [ms appendString:@">"]; + return ms; +} + @end /* NSBitmapCharacterSet */ /* diff --git a/libFoundation/Foundation/NSConcreteFileHandle.h b/libFoundation/Foundation/NSConcreteFileHandle.h index 19a3c234..e613513a 100644 --- a/libFoundation/Foundation/NSConcreteFileHandle.h +++ b/libFoundation/Foundation/NSConcreteFileHandle.h @@ -62,6 +62,10 @@ typedef enum { - (id)initWithFileDescriptor:(int)fd closeOnDealloc:(BOOL)flag; - (id)initWithPath:(NSString *)aPath flags:(int)flags createMode:(int)mode; ++ (id)fileHandleForReadingAtPath:(NSString *)path; ++ (id)fileHandleForWritingAtPath:(NSString *)path; ++ (id)fileHandleForUpdatingAtPath:(NSString *)path; + @end diff --git a/libFoundation/Foundation/NSConcreteFileHandle.m b/libFoundation/Foundation/NSConcreteFileHandle.m index 96d26c63..bccd84a0 100644 --- a/libFoundation/Foundation/NSConcreteFileHandle.m +++ b/libFoundation/Foundation/NSConcreteFileHandle.m @@ -96,13 +96,13 @@ static void _setFdBlocking(int fd, BOOL nonBlocking) { @implementation NSConcreteFileHandle -+ (id)fileHandleForReadingAtPath:(NSString*)path ++ (id)fileHandleForReadingAtPath:(NSString *)path { return AUTORELEASE([[self alloc] initWithPath:path flags:O_RDONLY createMode:0]); } -+ (id)fileHandleForWritingAtPath:(NSString*)path ++ (id)fileHandleForWritingAtPath:(NSString *)path { /* note: it's intended that flags do not include O_CREAT ! (see doc) */ return AUTORELEASE([[self alloc] @@ -110,7 +110,7 @@ static void _setFdBlocking(int fd, BOOL nonBlocking) { createMode:0]); } -+ (id)fileHandleForUpdatingAtPath:(NSString*)path ++ (id)fileHandleForUpdatingAtPath:(NSString *)path { /* note: it's intended that flags do not include O_CREAT ! (see doc) */ return AUTORELEASE([[self alloc] @@ -249,7 +249,7 @@ static void _setFdBlocking(int fd, BOOL nonBlocking) { if (length == UINT_MAX) data = [self readFileLength:LONG_MAX]; else { - NSAssert(length < LONG_MAX, + NSAssert(length < INT_MAX, @"cannot handle read's with %d bytes", length); data = [self readFileLength:length]; diff --git a/libFoundation/Foundation/NSConcreteMutableDictionary.m b/libFoundation/Foundation/NSConcreteMutableDictionary.m index e90aad87..eff11257 100644 --- a/libFoundation/Foundation/NSConcreteMutableDictionary.m +++ b/libFoundation/Foundation/NSConcreteMutableDictionary.m @@ -407,7 +407,7 @@ static __inline__ void mdRemove(NSConcreteMutableDictionary *table, id key) { if (aKey == nil) { [[[InvalidArgumentException alloc] initWithFormat: - @"nil key to be added in dictionary (object=0x%08X)", + @"nil key to be added in dictionary (object=0x%p)", anObject] raise]; } if (anObject == nil) { diff --git a/libFoundation/Foundation/NSConcreteMutableString.m b/libFoundation/Foundation/NSConcreteMutableString.m index 442bf611..6aee5a95 100644 --- a/libFoundation/Foundation/NSConcreteMutableString.m +++ b/libFoundation/Foundation/NSConcreteMutableString.m @@ -61,7 +61,7 @@ if ((bytes = NSReadContentsOfFile(_path, 1, &len))) { bytes[len] = '\0'; - return [self initWithCString:bytes length:len copy:NO]; + return [self initWithCString:(char *)bytes length:len copy:NO]; } else { self = AUTORELEASE(self); @@ -98,7 +98,7 @@ bytes = MallocAtomic (length); [aDecoder decodeArrayOfObjCType:@encode(char) count:length at:bytes]; return [[NSMutableSimple8BitString alloc] - initWithCString:bytes length:length copy:NO]; + initWithCString:(char *)bytes length:length copy:NO]; } - (NSData *)dataUsingEncoding:(NSStringEncoding)encoding @@ -112,7 +112,7 @@ len = [self cStringLength]; buf = NSZoneMallocAtomic(NULL, len + 1); - [self getCString:buf]; buf[len] = '\0'; + [self getCString:(char *)buf]; buf[len] = '\0'; return [NSData dataWithBytesNoCopy:buf length:len]; } @@ -123,7 +123,7 @@ len = [self cStringLength]; buf = NSZoneMallocAtomic(NULL, len + 1); - [self getCString:buf]; buf[len] = '\0'; + [self getCString:(char *)buf]; buf[len] = '\0'; if (!flag) { /* check for strict ANSI */ @@ -140,7 +140,7 @@ /* Accessing characters */ -- (void)getCharacters:(unichar*)buffer range:(NSRange)aRange +- (void)getCharacters:(unichar *)buffer range:(NSRange)aRange { register unsigned int i = 0; register unsigned char *bytes; @@ -152,7 +152,7 @@ raise]; } - bytes = [self __compact8BitBytes]; + bytes = (unsigned char *)[self __compact8BitBytes]; for (i = 0; i < aRange.length; i++) buffer[i] = bytes[i]; } @@ -167,14 +167,14 @@ /* Finding characters and substrings */ -- (NSRange)rangeOfCharacterFromSet:(NSCharacterSet*)aSet +- (NSRange)rangeOfCharacterFromSet:(NSCharacterSet *)aSet options:(unsigned int)mask range:(NSRange)aRange { // ENCODINGS - this code applies to the system's default encoding unsigned int i = 0; - + IMP imp = [aSet methodForSelector:@selector(characterIsMember:)]; - unsigned char *bytes = [self __compact8BitBytes]; + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; if (NSMaxRange(aRange) > [self cStringLength]) { [[[IndexOutOfRangeException alloc] initWithFormat: @@ -206,14 +206,16 @@ for (i = aRange.location; i < max; i++) { unichar c = bytes[i]; + + if ((*imp)(aSet, @selector(characterIsMember:), c)) + return NSMakeRange(i, 1); - if ((*imp)(aSet, @selector(characterIsMember:), c) || - ((mask & NSCaseInsensitiveSearch) && - ((islower(c) && - (*imp)(aSet, @selector(characterIsMember:), toupper(c))) || - (isupper(c) && - (*imp)(aSet, @selector(characterIsMember:), tolower(c)))) - )) + if ((mask & NSCaseInsensitiveSearch) && + ((islower(c) && + (*imp)(aSet, @selector(characterIsMember:), toupper(c))) || + (isupper(c) && + (*imp)(aSet, @selector(characterIsMember:), tolower(c)))) + ) { return NSMakeRange(i, 1); } @@ -244,8 +246,8 @@ raise]; } - mbytes = [self __compact8BitBytes] + aRange.location; - abytes = [(id)aString __compact8BitBytes]; + mbytes = (unsigned char *)[self __compact8BitBytes] + aRange.location; + abytes = (unsigned char *)[(id)aString __compact8BitBytes]; a = [aString cStringLength]; if ((a == 0) || (aRange.length < a)) @@ -388,8 +390,8 @@ raise]; } - mbytes = [self __compact8BitBytes] + aRange.location; - abytes = [(id)aString __compact8BitBytes]; + mbytes = (unsigned char *)[self __compact8BitBytes] + aRange.location; + abytes = (unsigned char *)[(id)aString __compact8BitBytes]; a = [aString cStringLength]; n = MIN(a, aRange.length); @@ -424,7 +426,7 @@ - (unsigned)hash { - unsigned char *bytes = [self __compact8BitBytes]; + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; unsigned hash = 0, hash2; int i, n = [self cStringLength]; @@ -458,8 +460,8 @@ mLen = [self cStringLength]; aLen = [aString length]; - mbytes = [self __compact8BitBytes]; - abytes = [(NS8BitString *)aString __compact8BitBytes]; + mbytes = (unsigned char *)[self __compact8BitBytes]; + abytes = (unsigned char *)[(NS8BitString *)aString __compact8BitBytes]; for (i = 0; (i < mLen) && (i < aLen); i++) { unsigned char c1 = mbytes[i]; @@ -485,7 +487,7 @@ int i; BOOL f = YES; int length = [self cStringLength]; - unsigned char *bytes = [self __compact8BitBytes]; + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; unsigned char *chars = MallocAtomic(sizeof(unichar)*(length+1)); for (i = 0; i < length; i++) { @@ -504,7 +506,8 @@ chars[i] = 0; return AUTORELEASE([[NSOwned8BitString alloc] - initWithCString:chars length:length copy:NO]); + initWithCString:(char *)chars length:length + copy:NO]); } - (NSString *)lowercaseString @@ -515,7 +518,7 @@ unsigned char *chars; length = [self cStringLength]; - bytes = [self __compact8BitBytes]; + bytes = (unsigned char *)[self __compact8BitBytes]; chars = MallocAtomic(sizeof(unsigned char) * (length + 1)); for (i = 0; i < length; i++) { @@ -526,7 +529,8 @@ chars[i] = 0; return AUTORELEASE([[NSOwned8BitString alloc] - initWithCString:chars length:length copy:NO]); + initWithCString:(char *)chars length:length + copy:NO]); } - (NSString *)uppercaseString @@ -534,7 +538,7 @@ // ENCODINGS - this code applies to the system's default encoding int i; int length = [self cStringLength]; - unsigned char *bytes = [self __compact8BitBytes]; + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; unsigned char *chars = MallocAtomic(sizeof(unichar)*(length+1)); for (i = 0; i < length; i++) { @@ -545,7 +549,8 @@ chars[i] = 0; return AUTORELEASE([[NSOwned8BitString alloc] - initWithCString:chars length:length copy:NO]); + initWithCString:(char *)chars length:length + copy:NO]); } /* Working with C strings */ @@ -553,9 +558,9 @@ - (void)getCString:(char *)buffer maxLength:(unsigned int)maxLength range:(NSRange)aRange remainingRange:(NSRange *)leftoverRange { - unsigned char *bytes = [self __compact8BitBytes]; - unsigned int toMove = MIN(maxLength, aRange.length); - unsigned int cLength = [self cStringLength]; + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; + unsigned int toMove = MIN(maxLength, aRange.length); + unsigned int cLength = [self cStringLength]; if (NSMaxRange(aRange) > cLength) { [[[IndexOutOfRangeException alloc] initWithFormat: @@ -588,8 +593,8 @@ const unsigned char *cString; int i, length; - cString = [self __compact8BitBytes]; - length = [self cStringLength]; + cString = (unsigned char *)[self __compact8BitBytes]; + length = [self cStringLength]; if (cString == NULL) return @"\"\""; if (cString[0] == '\0') return @"\"\""; @@ -597,12 +602,12 @@ /* Check if the string can be parsed as a STRING token by the property list parser. Otherwise we must enclose it in double quotes. */ if (lf_isPlistBreakChar(cString[0])) { - return lf_quoteString(cString, length); + return lf_quoteString((char *)cString, length); } for(i = 1; i < length; i++) { if (lf_isPlistBreakChar(cString[i])) - return lf_quoteString(cString, length); + return lf_quoteString((char *)cString, length); } return self; @@ -670,7 +675,7 @@ } else { lfFree(cString); - cString = byteString; + cString = (unsigned char *)byteString; cLength = cCapacity = length; } return self; @@ -682,7 +687,7 @@ [super dealloc]; } -- (const char*)cString +- (const char *)cString { unsigned char *str = MallocAtomic(sizeof(char)*(cLength + 1)); @@ -691,7 +696,7 @@ #if !LIB_FOUNDATION_BOEHM_GC [NSAutoreleasedPointer autoreleasePointer:str]; #endif - return str; + return (const char *)str; } - (unsigned int)cStringLength @@ -736,13 +741,14 @@ : [NSInline8BitString class]; return AUTORELEASE([[clazz allocForCapacity:aRange.length zone:NULL] - initWithCString:(self->cString + aRange.location) + initWithCString: + ((char *)self->cString + aRange.location) length:aRange.length]); } -- (char*)__compact8BitBytes +- (char *)__compact8BitBytes { - return self->cString; + return (char *)self->cString; } - (void)replaceCharactersInRange:(NSRange)aRange @@ -802,7 +808,7 @@ if (strLength) { NSRange range = { 0, strLength }; - [aString getCString:(self->cString + aRange.location) + [aString getCString:((char *)self->cString + aRange.location) maxLength:strLength range:range remainingRange:NULL]; diff --git a/libFoundation/Foundation/NSConcreteNumber.m b/libFoundation/Foundation/NSConcreteNumber.m index 365565e9..57413c5d 100644 --- a/libFoundation/Foundation/NSConcreteNumber.m +++ b/libFoundation/Foundation/NSConcreteNumber.m @@ -25,7 +25,7 @@ static NSString *strValues[64] = { #define CHK_STATIC_USTR \ if (data < 64) return strValues[(short)data]; -static unsigned char buf[256]; +static char buf[256]; // THREAD #define FMT_NUMSTR(__FMT__) \ if (NSStringClass == Nil) NSStringClass = [NSString class];\ sprintf(buf, __FMT__, data);\ @@ -50,7 +50,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -208,7 +208,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -367,7 +367,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -526,7 +526,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -685,7 +685,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -844,7 +844,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1003,7 +1003,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1162,7 +1162,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1321,7 +1321,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1480,7 +1480,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1639,7 +1639,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1798,7 +1798,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } @@ -1956,7 +1956,7 @@ static unsigned char buf[256]; return data; } -- (char)charValue +- (signed char)charValue { return data; } diff --git a/libFoundation/Foundation/NSConcreteNumber.m.sh b/libFoundation/Foundation/NSConcreteNumber.m.sh index 98d4b67c..0e60ad2e 100755 --- a/libFoundation/Foundation/NSConcreteNumber.m.sh +++ b/libFoundation/Foundation/NSConcreteNumber.m.sh @@ -37,7 +37,7 @@ cat < [self cStringLength]) { [[[IndexOutOfRangeException alloc] @@ -271,8 +271,8 @@ static unsigned int NSRange8BitString_total_len = 0; raise]; } - mbytes = [self __compact8BitBytes] + aRange.location; - abytes = [(id)aString __compact8BitBytes]; + mbytes = (unsigned char *)[self __compact8BitBytes] + aRange.location; + abytes = (unsigned char *)[(id)aString __compact8BitBytes]; a = [aString cStringLength]; if ((a == 0) || (aRange.length < a)) @@ -432,8 +432,8 @@ static unsigned int NSRange8BitString_total_len = 0; raise]; } - mbytes = [self __compact8BitBytes] + aRange.location; - abytes = [(id)aString __compact8BitBytes]; + mbytes = (unsigned char *)[self __compact8BitBytes] + aRange.location; + abytes = (unsigned char *)[(id)aString __compact8BitBytes]; a = [aString cStringLength]; n = MIN(a, aRange.length); @@ -521,8 +521,8 @@ static unsigned int NSRange8BitString_total_len = 0; mLen = [self cStringLength]; aLen = [aString length]; - mbytes = [self __compact8BitBytes]; - abytes = [(NS8BitString *)aString __compact8BitBytes]; + mbytes = (unsigned char *)[self __compact8BitBytes]; + abytes = (unsigned char *)[(NS8BitString *)aString __compact8BitBytes]; for (i = 0; (i < mLen) && (i < aLen); i++) { unsigned char c1 = mbytes[i]; @@ -548,7 +548,7 @@ static unsigned int NSRange8BitString_total_len = 0; int i; BOOL f = YES; int length = [self cStringLength]; - unsigned char* bytes = [self __compact8BitBytes]; + unsigned char* bytes = (unsigned char *)[self __compact8BitBytes]; unsigned char* chars = MallocAtomic(sizeof(unichar)*(length+1)); for (i = 0; i < length; i++) { @@ -567,7 +567,8 @@ static unsigned int NSRange8BitString_total_len = 0; chars[i] = 0; return AUTORELEASE([[NSOwned8BitString alloc] - initWithCString:chars length:length copy:NO]); + initWithCString:(char *)chars length:length + copy:NO]); } - (NSString *)lowercaseString @@ -575,8 +576,8 @@ static unsigned int NSRange8BitString_total_len = 0; // ENCODINGS - this code applies to the system's default encoding int i; int length = [self cStringLength]; - unsigned char *bytes = [self __compact8BitBytes]; - unsigned char *chars = MallocAtomic(sizeof(unichar)*(length+1)); + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; + unsigned char *chars = (unsigned char *)MallocAtomic(sizeof(unichar)*(length+1)); for (i = 0; i < length; i++) { register unsigned char c = bytes[i]; @@ -585,7 +586,7 @@ static unsigned int NSRange8BitString_total_len = 0; chars[i] = 0; return AUTORELEASE([[NSOwned8BitString alloc] - initWithCString:chars length:length copy:NO]); + initWithCString:(char *)chars length:length copy:NO]); } - (NSString *)uppercaseString @@ -593,8 +594,8 @@ static unsigned int NSRange8BitString_total_len = 0; // ENCODINGS - this code applies to the system's default encoding int i; int length = [self cStringLength]; - unsigned char *bytes = [self __compact8BitBytes]; - unsigned char *chars = MallocAtomic(sizeof(unichar)*(length+1)); + unsigned char *bytes = (unsigned char *)[self __compact8BitBytes]; + unsigned char *chars = (unsigned char *)MallocAtomic(sizeof(unichar)*(length+1)); for (i = 0; i < length; i++) { register unsigned char c = bytes[i]; @@ -604,7 +605,7 @@ static unsigned int NSRange8BitString_total_len = 0; chars[i] = 0; return AUTORELEASE([[NSOwned8BitString alloc] - initWithCString:chars length:length copy:NO]); + initWithCString:(char *)chars length:length copy:NO]); } /* Working with C strings */ @@ -612,7 +613,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (void)getCString:(char *)buffer maxLength:(unsigned int)maxLength range:(NSRange)aRange remainingRange:(NSRange*)leftoverRange { - unsigned char* bytes = [self __compact8BitBytes]; + unsigned char* bytes = (unsigned char *)[self __compact8BitBytes]; unsigned int toMove = MIN(maxLength, aRange.length); unsigned int cLength = [self cStringLength]; @@ -646,7 +647,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (void)encodeWithCoder:(NSCoder*)aCoder { - const unsigned char* bytes = [self __compact8BitBytes]; + const unsigned char* bytes = (unsigned char *)[self __compact8BitBytes]; int length = [self cStringLength]; [aCoder encodeValueOfObjCType:@encode(int) at:&length]; @@ -664,7 +665,8 @@ static unsigned int NSRange8BitString_total_len = 0; bytes = MallocAtomic (length + 1); [aDecoder decodeArrayOfObjCType:@encode(char) count:length at:bytes]; bytes[length] = '\0'; - return [[NSOwned8BitString alloc] initWithCString:bytes length:length copy:NO]; + return [[NSOwned8BitString alloc] + initWithCString:(char *)bytes length:length copy:NO]; } - (NSString *)stringRepresentation @@ -672,8 +674,8 @@ static unsigned int NSRange8BitString_total_len = 0; const unsigned char *cString; int i, length; - cString = [self __compact8BitBytes]; - length = [self cStringLength]; + cString = (unsigned char *)[self __compact8BitBytes]; + length = [self cStringLength]; if (cString == NULL) return @"\"\""; if (length == 0) return @"\"\""; @@ -682,12 +684,12 @@ static unsigned int NSRange8BitString_total_len = 0; /* Check if the string can be parsed as a STRING token by the property list parser. Otherwise we must enclose it in double quotes. */ if (lf_isPlistBreakChar(cString[0])) { - return lf_quoteString(cString, length); + return lf_quoteString((char *)cString, length); } for(i = 1; i < length; i++) { if (lf_isPlistBreakChar(cString[i])) - return lf_quoteString(cString, length); + return lf_quoteString((char *)cString, length); } return self; @@ -721,9 +723,10 @@ static unsigned int NSRange8BitString_total_len = 0; len = [self cStringLength]; buf = NSZoneMalloc(NULL, sizeof(unsigned char) * len + 1); - [self getCString:buf]; + [self getCString:(char *)buf]; buf[len] = '\0'; - return [NSDataClass dataWithBytesNoCopy:buf length:strlen(buf)]; + return [NSDataClass dataWithBytesNoCopy:(char *)buf + length:strlen((char *)buf)]; } if (encoding == NSASCIIStringEncoding) { register unsigned len = [self cStringLength]; @@ -733,7 +736,7 @@ static unsigned int NSRange8BitString_total_len = 0; buf = NSZoneMalloc(NULL, sizeof(char) * len + 1); buf[len] = '\0'; - [self getCString:buf]; + [self getCString:(char *)buf]; if (!flag) { /* check for strict ASCII */ for (i = 0; i < len; i++) @@ -762,7 +765,8 @@ static unsigned int NSRange8BitString_total_len = 0; + (id)allocForCapacity:(unsigned int)capacity zone:(NSZone *)zone { - NSInline8BitString *str = NSAllocateObject(self, capacity, zone); + NSInline8BitString *str = (NSInline8BitString *) + NSAllocateObject(self, capacity, zone); str->cLength = -1; return str; } @@ -819,7 +823,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (const char *)cString { - return self->cString; + return (const char *)self->cString; } - (unsigned int)cStringLength @@ -855,13 +859,13 @@ static unsigned int NSRange8BitString_total_len = 0; return AUTORELEASE([[NSRange8BitString alloc] initWithString:self - bytes:(self->cString + aRange.location) + bytes:((char *)self->cString + aRange.location) length:aRange.length]); } - (char *)__compact8BitBytes { - return self->cString; + return (char *)self->cString; } - (unsigned)hash @@ -890,7 +894,8 @@ static unsigned int NSRange8BitString_total_len = 0; + (id)allocForCapacity:(unsigned int)capacity zone:(NSZone*)zone { - NSShortInline8BitString *str = NSAllocateObject(self, capacity, zone); + NSShortInline8BitString *str = (NSShortInline8BitString *) + NSAllocateObject(self, capacity, zone); str->cLength = 255; return str; } @@ -948,7 +953,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (const char *)cString { - return self->cString; + return (const char *)self->cString; } - (unsigned int)cStringLength @@ -1013,13 +1018,13 @@ static unsigned int NSRange8BitString_total_len = 0; return AUTORELEASE([[NSRange8BitString alloc] initWithString:self - bytes:(self->cString + aRange.location) + bytes:((char *)self->cString + aRange.location) length:aRange.length]); } - (char *)__compact8BitBytes { - return self->cString; + return (char *)self->cString; } - (NSComparisonResult)compare:(NSString *)aString @@ -1060,7 +1065,7 @@ static unsigned int NSRange8BitString_total_len = 0; } mbytes = self->cString + aRange.location; - abytes = [(id)aString __compact8BitBytes]; + abytes = (unsigned char *)[(id)aString __compact8BitBytes]; a = [aString cStringLength]; n = MIN(a, aRange.length); @@ -1181,7 +1186,7 @@ static unsigned int NSRange8BitString_total_len = 0; /* same length */ mbytes = self->cString; - abytes = [(id)aString __compact8BitBytes]; + abytes = (unsigned char *)[(id)aString __compact8BitBytes]; /* using memcmp is probably faster than looping on our own */ return memcmp(self->cString, abytes, a) == 0 ? YES : NO; @@ -1224,7 +1229,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (const char *)cString { - return &(self->c[0]); + return (const char *)&(self->c[0]); } - (unsigned int)cStringLength @@ -1263,7 +1268,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (char *)__compact8BitBytes { - return &(self->c[0]); + return (char *)&(self->c[0]); } - (unsigned)hash @@ -1296,7 +1301,7 @@ static unsigned int NSRange8BitString_total_len = 0; raise]; } self->cLength = 0; - self->cString = ""; + self->cString = (unsigned char *)""; return self; } @@ -1314,7 +1319,7 @@ static unsigned int NSRange8BitString_total_len = 0; sel_get_name(_cmd), NSStringFromClass([self class])] raise]; } cLength = length; - cString = byteString; + cString = (unsigned char *)byteString; return self; } @@ -1329,7 +1334,7 @@ static unsigned int NSRange8BitString_total_len = 0; - (const char *)cString { - return self->cString; + return (const char *)self->cString; } - (unsigned int)cStringLength @@ -1366,13 +1371,13 @@ static unsigned int NSRange8BitString_total_len = 0; return AUTORELEASE([[NSRange8BitString alloc] initWithString:self - bytes:cString + aRange.location + bytes:(char *)cString + aRange.location length:aRange.length]); } -- (char*)__compact8BitBytes +- (char *)__compact8BitBytes { - return self->cString; + return (char *)self->cString; } @end /* NSNonOwned8BitString */ @@ -1410,7 +1415,7 @@ static unsigned int NSRange8BitString_total_len = 0; self->cString[self->cLength] = 0; } else - self->cString = byteString; + self->cString = (unsigned char *)byteString; return self; } @@ -1426,7 +1431,17 @@ static unsigned int NSRange8BitString_total_len = 0; @end /* NSOwned8BitString */ -#if 1 + +#define USE_LIB_FOUNDATION_CUSTOM_CONSTSTR 1 +#define USE_LIB_FOUNDATION_CONSTSTR 1 + +#if USE_LIB_FOUNDATION_CONSTSTR + +#if USE_LIB_FOUNDATION_CUSTOM_CONSTSTR +# define NXConstantString NSConstantString +#endif + +/* this requires that we use the special libFoundation libobjc */ @implementation NXConstantString - (oneway void)release @@ -1451,10 +1466,22 @@ static unsigned int NSRange8BitString_total_len = 0; - (void)dealloc { [self shouldNotImplement:_cmd]; + + /* this is to please gcc 4.1 which otherwise issues a warning (and we + don't know the -W option to disable it, let me know if you do ;-)*/ + if (0) [super dealloc]; } @end /* NXConstantString */ + +#if USE_LIB_FOUNDATION_CUSTOM_CONSTSTR +# undef NXConstantString +#endif + #else + +#warning NOT USING BUILTIN NXConstantString + @interface DummyNXConstantString : NSNonOwned8BitString @end @@ -1487,13 +1514,16 @@ static unsigned int NSRange8BitString_total_len = 0; { static BOOL didLoad = NO; +#warning DEBUG LOG + printf("LOAD DUMMY\n"); + if (!didLoad) { Class metaClass; Class constantStringClass; Class constantStringMetaClass; didLoad = YES; - + metaClass = ((DummyNXConstantString*)self)->isa; constantStringClass = objc_lookup_class ("NXConstantString"); constantStringMetaClass = constantStringClass->class_pointer; @@ -1504,7 +1534,12 @@ static unsigned int NSRange8BitString_total_len = 0; constantStringClass->name = constantStringMetaClass->name = "NXConstantString"; - + + /* + Note: this doesn't work for dynamically loaded NSString categories, + that is categories either contained in bundles OR in libraries + which are loaded on-demand in case a bundle is loaded. + */ class_add_behavior(constantStringClass, self); } } @@ -1523,7 +1558,7 @@ static unsigned int NSRange8BitString_total_len = 0; } #endif -- (const char*)cString +- (const char *)cString { unsigned char *str; @@ -1533,7 +1568,7 @@ static unsigned int NSRange8BitString_total_len = 0; #if !LIB_FOUNDATION_BOEHM_GC [NSAutoreleasedPointer autoreleasePointer:str]; #endif - return str; + return (const char *)str; } @end /* NSNonOwnedOpen8BitString */ @@ -1565,7 +1600,8 @@ static unsigned int NSRange8BitString_total_len = 0; } if (strlen(byteString) < length) { - printf("LENGTH DIFFERS: %i vs %i\n", strlen(byteString), length); + printf("LENGTH DIFFERS: %ld vs %d\n", + (unsigned long)strlen(byteString), length); abort(); } @@ -1578,7 +1614,7 @@ static unsigned int NSRange8BitString_total_len = 0; cString[length] = 0; } else - self->cString = byteString; + self->cString = (unsigned char *)byteString; return self; } @@ -1591,11 +1627,12 @@ static unsigned int NSRange8BitString_total_len = 0; #if !LIB_FOUNDATION_BOEHM_GC [NSAutoreleasedPointer autoreleasePointer:str]; #endif - return str; + return (const char *)str; } @end /* NSOwnedOpen8BitString */ + @implementation NSRange8BitString /* final */ - (id)initWithString:(NSString *)aParent @@ -1607,7 +1644,7 @@ static unsigned int NSRange8BitString_total_len = 0; raise]; } - self->cString = bytes; + self->cString = (unsigned char *)bytes; self->cLength = length; self->parent = RETAIN(aParent); return self; @@ -1636,7 +1673,7 @@ static unsigned int NSRange8BitString_total_len = 0; return AUTORELEASE([[NSRange8BitString alloc] initWithString:parent - bytes:cString+aRange.location + bytes:((char *)cString + aRange.location) length:aRange.length]); } diff --git a/libFoundation/Foundation/NSConcreteTimeZone.m b/libFoundation/Foundation/NSConcreteTimeZone.m index 3b8e4e23..45f85f30 100644 --- a/libFoundation/Foundation/NSConcreteTimeZone.m +++ b/libFoundation/Foundation/NSConcreteTimeZone.m @@ -349,7 +349,7 @@ static NSTimeZone* gmtTimeZone = nil; return self; } -- (id)detailForDate:(NSDate *)date +- (id)detailForDate:(NSCalendarDate *)date { return self->detail; } @@ -477,11 +477,11 @@ static NSTimeZone* gmtTimeZone = nil; } } -- (NSDate *)startDate +- (NSCalendarDate *)startDate { return self->startDate; } -- (NSDate *)endDate +- (NSCalendarDate *)endDate { return self->endDate; } diff --git a/libFoundation/Foundation/NSConcreteUTF16String.m b/libFoundation/Foundation/NSConcreteUTF16String.m index 9fbbc27c..a72ef7a7 100644 --- a/libFoundation/Foundation/NSConcreteUTF16String.m +++ b/libFoundation/Foundation/NSConcreteUTF16String.m @@ -132,13 +132,13 @@ extern int NSConvertUTF16toUTF8(unichar **sourceStart, [data getBytes:self->cString]; self->cString[len] = '\0'; } - return self->cString; + return (const char *)self->cString; } - (unsigned int)cStringLength { - const unsigned char *cstr; + const char *cstr; - if ((cstr = [self cString])) + if ((cstr = [self cString]) != NULL) return strlen(cstr); return 0; } @@ -158,7 +158,7 @@ extern int NSConvertUTF16toUTF8(unichar **sourceStart, unsigned int toMove, i, cLength; const unsigned char *cstr; - cstr = [self cString]; + cstr = (const unsigned char *)[self cString]; toMove = MIN(maxLength, aRange.length); cLength = [self cStringLength]; diff --git a/libFoundation/Foundation/NSConcreteUnixTask.m b/libFoundation/Foundation/NSConcreteUnixTask.m index 93042c98..0ccc78b5 100644 --- a/libFoundation/Foundation/NSConcreteUnixTask.m +++ b/libFoundation/Foundation/NSConcreteUnixTask.m @@ -729,8 +729,8 @@ static int debugNSTask = -1; char buffer[512]; sprintf(buffer, - "<0x%08X<%s> isRunning=%s childHasFinished=%s pid=%d>", - (unsigned)self, (char*)object_get_class_name(self), + "<0x%p<%s> isRunning=%s childHasFinished=%s pid=%d>", + self, (char*)object_get_class_name(self), self->isRunning ? "YES" : "NO", self->childHasFinished ? "YES" : "NO", (unsigned)self->pid); diff --git a/libFoundation/Foundation/NSConcreteValue.m b/libFoundation/Foundation/NSConcreteValue.m index 8a10613f..0baecd64 100644 --- a/libFoundation/Foundation/NSConcreteValue.m +++ b/libFoundation/Foundation/NSConcreteValue.m @@ -218,11 +218,16 @@ return self; } -- (BOOL)isEqual:(NSValue*)aValue +- (BOOL)isEqual:(id)aValue { - return Strcmp([self objCType], [aValue objCType]) == 0 + if (aValue == nil) + return NO; + + // Note: we do not check the aValue class, I think this is an intended + // optimization? (we could quickly check using *(Class *)obj?) + return Strcmp([self objCType], [(NSValue *)aValue objCType]) == 0 && [[self nonretainedObjectValue] - isEqual:[aValue nonretainedObjectValue]]; + isEqual:[(NSValue *)aValue nonretainedObjectValue]]; } // NSCopying diff --git a/libFoundation/Foundation/NSData.m b/libFoundation/Foundation/NSData.m index caa7920a..e8f6fa70 100644 --- a/libFoundation/Foundation/NSData.m +++ b/libFoundation/Foundation/NSData.m @@ -43,7 +43,7 @@ + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject(((self == [NSData class]) ? - [NSConcreteData class] : self), 0, zone); + [NSConcreteData class] : (Class)self), 0, zone); } + (id)data @@ -332,18 +332,20 @@ } case _C_ARY_B: { int i, count, offset, itemSize; - const unsigned char* itemType; - + const char *itemType; + count = Atoi(type + 1); itemType = type; - while(isdigit(*++itemType)); - itemSize = objc_sizeof_type(itemType); - - for(i = offset = 0; i < count; i++, offset += itemSize) - [self deserializeDataAt:(char*)data + offset - ofObjCType:itemType - atCursor:cursor - context:callback]; + while (isdigit(*++itemType)) + ; + itemSize = objc_sizeof_type(itemType); + + for(i = offset = 0; i < count; i++, offset += itemSize) { + [self deserializeDataAt:(char*)data + offset + ofObjCType:itemType + atCursor:cursor + context:callback]; + } break; } case _C_STRUCT_B: { @@ -504,7 +506,8 @@ + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject(((self == [NSMutableData class]) ? - [NSConcreteMutableData class] : self), 0, zone); + [NSConcreteMutableData class] : (Class)self), + 0, zone); } + (id)dataWithCapacity:(unsigned int)numBytes @@ -637,17 +640,18 @@ } case _C_ARY_B: { int i, offset, itemSize, count = Atoi(type + 1); - const unsigned char* itemType = type; - - while(isdigit(*++itemType)); - itemSize = objc_sizeof_type(itemType); - - for(i = offset = 0; i < count; i++, offset += itemSize) - [self serializeDataAt:(char*)data + offset - ofObjCType:itemType - context:callback]; - - break; + const char *itemType = type; + + while (isdigit(*++itemType)) + ; + itemSize = objc_sizeof_type(itemType); + + for (i = offset = 0; i < count; i++, offset += itemSize) { + [self serializeDataAt:(char*)data + offset + ofObjCType:itemType + context:callback]; + } + break; } case _C_STRUCT_B: { int offset = 0; diff --git a/libFoundation/Foundation/NSDate.h b/libFoundation/Foundation/NSDate.h index 5e4b096a..51634833 100644 --- a/libFoundation/Foundation/NSDate.h +++ b/libFoundation/Foundation/NSDate.h @@ -113,7 +113,7 @@ JD 0.0 = 12 noon on 1 Jan 4713 B.C.E., which is -51909.5L*24*60*60 @class NSTimeZoneDetail; -@interface NSTimeZone: NSObject +@interface NSTimeZone : NSObject + (void)setDefaultTimeZone:(NSTimeZone*)aTimeZone; + (NSTimeZone*)defaultTimeZone; diff --git a/libFoundation/Foundation/NSDate.m b/libFoundation/Foundation/NSDate.m index 4d2d82cb..368c73d4 100644 --- a/libFoundation/Foundation/NSDate.m +++ b/libFoundation/Foundation/NSDate.m @@ -66,31 +66,31 @@ static NSDate *distantFuture = nil, *distantPast = nil; + (id)allocWithZone:(NSZone *)zone { return NSAllocateObject( (self == [NSDate class]) ? - [NSConcreteDate class] : self, 0, zone); + [NSConcreteDate class] : (Class)self, 0, zone); } -+ (NSDate *)date ++ (id)date { return AUTORELEASE([[self alloc] init]); } -+ (NSDate *)dateWithTimeIntervalSinceNow:(NSTimeInterval)secs ++ (id)dateWithTimeIntervalSinceNow:(NSTimeInterval)secs { return AUTORELEASE([[self alloc] initWithTimeIntervalSinceNow:secs]); } -+ (NSDate *)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)secs ++ (id)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)secs { return AUTORELEASE([[self alloc] initWithTimeIntervalSinceReferenceDate:secs]); } -+ (NSDate *)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds ++ (id)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds { return AUTORELEASE([[self alloc] initWithTimeIntervalSince1970:seconds]); } -+ (NSDate *)distantFuture ++ (id)distantFuture { if (distantFuture == nil) { distantFuture = [[self alloc] @@ -99,7 +99,7 @@ static NSDate *distantFuture = nil, *distantPast = nil; return distantFuture; } -+ (NSDate *)distantPast ++ (id)distantPast { if (distantPast == nil) { distantPast = [[self alloc] @@ -128,14 +128,14 @@ static NSDate *distantFuture = nil, *distantPast = nil; return self; } -- (NSDate *)initWithTimeInterval:(NSTimeInterval)secsToBeAdded - sinceDate:(NSDate *)anotherDate +- (id)initWithTimeInterval:(NSTimeInterval)secsToBeAdded + sinceDate:(NSDate *)anotherDate { return [self initWithTimeIntervalSinceReferenceDate: (secsToBeAdded + [anotherDate timeIntervalSinceReferenceDate])]; } -- (NSDate *)initWithTimeIntervalSinceNow:(NSTimeInterval)secsToBeAddedToNow +- (id)initWithTimeIntervalSinceNow:(NSTimeInterval)secsToBeAddedToNow { [self initWithTimeIntervalSinceReferenceDate: (secsToBeAddedToNow + [NSDate timeIntervalSinceReferenceDate])]; @@ -303,7 +303,7 @@ static NSDate *distantFuture = nil, *distantPast = nil; anotherDate : self; } -- (NSComparisonResult)compare:(NSDate *)other +- (NSComparisonResult)compare:(id)other { [self subclassResponsibility:_cmd]; return NSOrderedSame; @@ -321,8 +321,8 @@ static NSDate *distantFuture = nil, *distantPast = nil; } /* Converting to an NSCalendar Object */ -- (NSCalendarDate *)dateWithCalendarFormat:(NSString *)aFormatString - timeZone:(NSTimeZone *)aTimeZone +- (id)dateWithCalendarFormat:(NSString *)aFormatString + timeZone:(NSTimeZone *)aTimeZone { id new = AUTORELEASE([[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate: diff --git a/libFoundation/Foundation/NSDecimalNumber.m b/libFoundation/Foundation/NSDecimalNumber.m index c014d9e3..359c53da 100644 --- a/libFoundation/Foundation/NSDecimalNumber.m +++ b/libFoundation/Foundation/NSDecimalNumber.m @@ -158,7 +158,7 @@ static NSDecimalNumber *nan = nil; // THREAD { return [self initWithInt:value ? 1 : 0]; } -- (id)initWithChar:(char)value +- (id)initWithChar:(signed char)value { return [self initWithInt:value]; } @@ -166,7 +166,7 @@ static NSDecimalNumber *nan = nil; // THREAD { return [self initWithInt:value]; } -- (id)initWithShort:(short)value +- (id)initWithShort:(signed short)value { return [self initWithInt:value]; } @@ -175,7 +175,7 @@ static NSDecimalNumber *nan = nil; // THREAD return [self initWithInt:value]; } -- (id)initWithInt:(int)value +- (id)initWithInt:(signed int)value { NSDecimal d; d.exponent = 0; @@ -198,7 +198,7 @@ static NSDecimalNumber *nan = nil; // THREAD return [self initWithDecimal:d]; } -- (id)initWithLong:(long)value +- (id)initWithLong:(signed long)value { NSDecimal d; d.exponent = 0; @@ -221,7 +221,7 @@ static NSDecimalNumber *nan = nil; // THREAD return [self initWithDecimal:d]; } -- (id)initWithLongLong:(long long)value +- (id)initWithLongLong:(signed long long)value { NSDecimal d; d.exponent = 0; @@ -308,7 +308,7 @@ static NSDecimalNumber *nan = nil; // THREAD { return [self intValue] ? YES : NO; } -- (char)charValue +- (signed char)charValue { return [self intValue]; } @@ -316,7 +316,7 @@ static NSDecimalNumber *nan = nil; // THREAD { return [self intValue]; } -- (short)shortValue +- (signed short)shortValue { return [self intValue]; } @@ -331,7 +331,7 @@ static NSDecimalNumber *nan = nil; // THREAD return self->decimal.mantissa; return [self doubleValue]; } -- (long)longValue +- (signed long)longValue { return [self doubleValue]; } @@ -341,7 +341,7 @@ static NSDecimalNumber *nan = nil; // THREAD return self->decimal.mantissa; return [self doubleValue]; } -- (long long)longLongValue +- (signed long long)longLongValue { return [self doubleValue]; } diff --git a/libFoundation/Foundation/NSDefaultZone.m b/libFoundation/Foundation/NSDefaultZone.m index 2d71dca2..0bc17e3e 100644 --- a/libFoundation/Foundation/NSDefaultZone.m +++ b/libFoundation/Foundation/NSDefaultZone.m @@ -100,8 +100,8 @@ static inline void _memoryExhausted(void **p, unsigned size) #if DEBUG if ((logAlloc != (void*)-1) && (logAlloc != NULL)) { fprintf(logAlloc, - "zmalloc: 0x%08X size=%d zone=0x%08X\n", - (unsigned)p, size, (unsigned)self); + "zmalloc: 0x%p size=%d zone=0x%p\n", + p, size, self); } #endif @@ -116,8 +116,7 @@ static inline void _memoryExhausted(void **p, unsigned size) #if DEBUG if ((logAlloc != (void*)-1) && (logAlloc != NULL)) { fprintf(logAlloc, - "zmalloc-a: 0x%08X size=%d zone=0x%08X\n", - (unsigned)p, size, (unsigned)self); + "zmalloc-a: 0x%p size=%d zone=0x%p\n", p, size, self); } #endif @@ -132,8 +131,8 @@ static inline void _memoryExhausted(void **p, unsigned size) #if DEBUG if ((logAlloc != (void*)-1) && (logAlloc != NULL)) { fprintf(logAlloc, - "zcalloc: 0x%08X size=%d (%d * %d) zone=0x%08X\n", - (unsigned)p, count*size, count, size, (unsigned)self); + "zcalloc: 0x%p size=%d (%d * %d) zone=0x%p\n", + p, count*size, count, size, self); } #endif @@ -148,8 +147,8 @@ static inline void _memoryExhausted(void **p, unsigned size) #if DEBUG if ((logAlloc != (void*)-1) && (logAlloc != NULL)) { fprintf(logAlloc, - "zcalloc-a: 0x%08X size=%d (%d * %d) zone=0x%08X\n", - (unsigned)p, count*size, count, size, (unsigned)self); + "zcalloc-a: 0x%p size=%d (%d * %d) zone=0x%p\n", + p, count*size, count, size, self); } #endif @@ -168,8 +167,8 @@ static inline void _memoryExhausted(void **p, unsigned size) #if DEBUG if ((logAlloc != (void*)-1) && (logAlloc != NULL)) { fprintf(logAlloc, - "zrealloc: 0x%08X->0x%08X size=%d zone=0x%08X\n", - (unsigned)p, (unsigned)new_p, size, (unsigned)self); + "zrealloc: 0x%p->0x%p size=%d zone=0x%p\n", + p, new_p, size, self); } #endif @@ -186,8 +185,7 @@ static inline void _memoryExhausted(void **p, unsigned size) if (p) { #if DEBUG if ((logAlloc != (void*)-1) && (logAlloc != NULL)) { - fprintf(logAlloc, "zfree: 0x%08X zone=0x%08X\n", - (unsigned)p, (unsigned)self); + fprintf(logAlloc, "zfree: 0x%p zone=0x%p\n", p, self); } #endif objc_free(p); diff --git a/libFoundation/Foundation/NSDictionary.m b/libFoundation/Foundation/NSDictionary.m index 5794abae..71216541 100644 --- a/libFoundation/Foundation/NSDictionary.m +++ b/libFoundation/Foundation/NSDictionary.m @@ -71,7 +71,8 @@ + (id)allocWithZone:(NSZone *)zone { return NSAllocateObject( (self == [NSDictionary class]) ? - [NSConcreteHashDictionary class] : self, 0, zone); + [NSConcreteHashDictionary class] : (Class)self, + 0, zone); } + (id)allocWithZone:(NSZone *)_zone forCapacity:(unsigned)_capacity { if (self == [NSDictionary class]) { @@ -478,7 +479,7 @@ static NSArray *emptyArray = nil; value = [self objectForKey:key]; #if DEBUG - NSAssert3(value, @"got no value for key %@ in 0x%08X<%@>", + NSAssert3(value, @"got no value for key %@ in 0x%p<%@>", key, self, NSStringFromClass([self class])); #endif descHolder->keyDescription = @@ -718,12 +719,14 @@ static NSArray *emptyArray = nil; + (id)allocWithZone:(NSZone *)zone { - return NSAllocateObject( (self == [NSMutableDictionary class]) ? - [NSConcreteMutableDictionary class] : self, 0, zone); + return NSAllocateObject( (self == [NSMutableDictionary class]) + ? [NSConcreteMutableDictionary class] + : (Class)self, 0, zone); } + (id)allocWithZone:(NSZone *)zone forCapacity:(unsigned)_capacity { - return NSAllocateObject( (self == [NSMutableDictionary class]) ? - [NSConcreteMutableDictionary class] : self, 0, zone); + return NSAllocateObject( (self == [NSMutableDictionary class]) + ? [NSConcreteMutableDictionary class] + : (Class)self, 0, zone); } + (id)dictionaryWithCapacity:(unsigned int)aNumItems diff --git a/libFoundation/Foundation/NSException.m b/libFoundation/Foundation/NSException.m index ca6ad1e8..55b0466a 100644 --- a/libFoundation/Foundation/NSException.m +++ b/libFoundation/Foundation/NSException.m @@ -79,17 +79,17 @@ static NSUncaughtExceptionHandler* uncaughtHandler = _default_exception_handler; #endif static NSHandler firstExceptionHandler; -static NSHandler* lastHandler = NULL; -static BOOL isMultiThreaded = NO; +static NSHandler *lastHandler = NULL; +static BOOL isMultiThreaded = NO; -void _init_first_exception_handler(NSHandler* handler) +void _init_first_exception_handler(NSHandler *handler) { -static BOOL initialized = NO; + static BOOL initialized = NO; if (!initialized) { handler->previousHandler = NULL; memset(&(handler->jmpState), 0, sizeof(jmp_buf)); #ifndef BROKEN_COMPILER - handler->handler = _default_exception_handler; + handler->handler = (THandlerFunction)_default_exception_handler; #endif } } @@ -252,11 +252,13 @@ void _NSRemoveHandler(NSHandler *handler) - (NSString *)descriptionWithLocale:(NSDictionary *)locale { return [NSString stringWithFormat: - @"(Exception name:%@ class:%@ reason:%@ info:%@)", - name ? name : @"", - NSStringFromClass(isa), - reason ? reason : @"", - userInfo ? [userInfo descriptionWithLocale:locale] : @""]; + @"(Exception name:%@ class:%@ reason:%@ info:%@)", + name ? name : (NSString *)@"", + NSStringFromClass(isa), + reason ? reason : (NSString *)@"", + userInfo + ? [userInfo descriptionWithLocale:locale] + : (NSString *)@""]; } - (NSString *)description @@ -361,12 +363,13 @@ NSUncaughtExceptionHandler *NSGetUncaughtExceptionHandler(void) #ifdef BROKEN_COMPILER return uncaughtHandler; #else - return firstExceptionHandler.handler; + return (NSUncaughtExceptionHandler *)firstExceptionHandler.handler; #endif } - else + else { return [[[NSThread currentThread] _privateThreadData] - uncaughtExceptionHandler]; + uncaughtExceptionHandler]; + } } void NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler *handler) @@ -377,7 +380,7 @@ void NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler *handler) #ifdef BROKEN_COMPILER uncaughtHandler = handler; #else - firstExceptionHandler.handler = handler; + firstExceptionHandler.handler = (THandlerFunction)handler; #endif } else diff --git a/libFoundation/Foundation/NSFileHandle.m b/libFoundation/Foundation/NSFileHandle.m index e1c064b0..0a59ef61 100644 --- a/libFoundation/Foundation/NSFileHandle.m +++ b/libFoundation/Foundation/NSFileHandle.m @@ -51,7 +51,7 @@ static NSFileHandle *nullDevice = nil; { return (self == [NSFileHandle class]) ? [NSConcreteFileHandle allocWithZone:zone] - : NSAllocateObject(self, 0, zone); + : (id)NSAllocateObject(self, 0, zone); } + (id)fileHandleForReadingAtPath:(NSString*)path diff --git a/libFoundation/Foundation/NSFileManager.m b/libFoundation/Foundation/NSFileManager.m index 786e074d..c9711027 100644 --- a/libFoundation/Foundation/NSFileManager.m +++ b/libFoundation/Foundation/NSFileManager.m @@ -572,9 +572,10 @@ extern NSRecursiveLock* libFoundationLock; NSDictionary *errorInfo; errorInfo = [NSDictionary dictionaryWithObjectsAndKeys: - path ? path : @"", @"Path", + path ? path : (NSString *)@"", + @"Path", @"cannot remove file", @"Error", - nil]; + nil]; if (![handler fileManager:self shouldProceedAfterError:errorInfo]) return NO; @@ -611,9 +612,10 @@ extern NSRecursiveLock* libFoundationLock; errorInfo = [NSDictionary dictionaryWithObjectsAndKeys: - path ? path : @"", @"Path", - @"cannot remove directory", @"Error", - nil]; + path ? path : (NSString *)@"", + @"Path", + @"cannot remove directory", @"Error", + nil]; if (![handler fileManager:self shouldProceedAfterError:errorInfo]) return NO; diff --git a/libFoundation/Foundation/NSHost.m b/libFoundation/Foundation/NSHost.m index f29ebb4c..e763d247 100644 --- a/libFoundation/Foundation/NSHost.m +++ b/libFoundation/Foundation/NSHost.m @@ -188,7 +188,7 @@ static NSRecursiveLock *hostsLock = nil; - (NSString *)description { - return [NSString stringWithFormat:@"<0x%08X[%@]: names=%@, addresses=%@>", + return [NSString stringWithFormat:@"<0x%p[%@]: names=%@, addresses=%@>", self, NSStringFromClass([self class]), [self->names componentsJoinedByString:@","], [self->addresses componentsJoinedByString:@","]]; @@ -270,7 +270,7 @@ static NSRecursiveLock *hostsLock = nil; } ipAddress.s_addr = inet_addr((char*)[address cString]); - if (ipAddress.s_addr == (unsigned long)-1) { + if (ipAddress.s_addr == INADDR_NONE) { RELEASE(self); return nil; } diff --git a/libFoundation/Foundation/NSMappedData.m b/libFoundation/Foundation/NSMappedData.m index f8d44ede..597597d3 100644 --- a/libFoundation/Foundation/NSMappedData.m +++ b/libFoundation/Foundation/NSMappedData.m @@ -81,7 +81,7 @@ { bytes = mmap(0, length, PROT_READ, MAP_SHARED, [file fileDescriptor], 0); - if ((int)bytes == -1) { + if ((long)bytes == -1L) { bytes = NULL; (void)AUTORELEASE(self); return nil; diff --git a/libFoundation/Foundation/NSMethodSignature.m b/libFoundation/Foundation/NSMethodSignature.m index cb3b573f..b56f46ef 100644 --- a/libFoundation/Foundation/NSMethodSignature.m +++ b/libFoundation/Foundation/NSMethodSignature.m @@ -84,11 +84,11 @@ static NSMapTable *methodSignatureCache = NULL; #endif } -+ (NSMethodSignature*)signatureWithObjCTypes:(const char*)_types ++ (NSMethodSignature *)signatureWithObjCTypes:(const char *)_types { extern NSLock *libFoundationLock; NSMethodSignature *signature; - const unsigned char *p; + const char *p; if(_types == NULL) { [[[InvalidArgumentException new] diff --git a/libFoundation/Foundation/NSNotification.m b/libFoundation/Foundation/NSNotification.m index 532934f6..e45f97cf 100644 --- a/libFoundation/Foundation/NSNotification.m +++ b/libFoundation/Foundation/NSNotification.m @@ -108,8 +108,9 @@ + allocWithZone:(NSZone *)zone { - return NSAllocateObject( (self == [NSNotification class]) ? - [NSConcreteNotification class] : self, 0, zone); + return NSAllocateObject( (self == [NSNotification class]) + ? [NSConcreteNotification class] : (Class)self, + 0, zone); } + (NSNotification *)notificationWithName:(NSString *)name object:object diff --git a/libFoundation/Foundation/NSNotificationCenter.m b/libFoundation/Foundation/NSNotificationCenter.m index 9f985bfd..0498aaa6 100644 --- a/libFoundation/Foundation/NSNotificationCenter.m +++ b/libFoundation/Foundation/NSNotificationCenter.m @@ -106,7 +106,7 @@ - (NSString *)description { - return [NSString stringWithFormat:@"<%@ 0x%08X: observer=%@ sel=%@>", + return [NSString stringWithFormat:@"<%@ 0x%p: observer=%@ sel=%@>", NSStringFromClass([self class]), self, self->observer, NSStringFromSelector(self->selector) ]; @@ -472,9 +472,7 @@ static BOOL isMultiThreaded = NO; if (notificationName == nil) reg = nullNameToObjects; else { - notificationName - = AUTORELEASE([notificationName - copyWithZone:[notificationName zone]]); + notificationName = AUTORELEASE([notificationName copy]); reg = NSMapGet (nameToObjects, notificationName); if (!reg) { reg = AUTORELEASE([[NSNotificationObjectRegister alloc] init]); diff --git a/libFoundation/Foundation/NSNotificationQueue.m b/libFoundation/Foundation/NSNotificationQueue.m index b849b815..d2a0fc2a 100644 --- a/libFoundation/Foundation/NSNotificationQueue.m +++ b/libFoundation/Foundation/NSNotificationQueue.m @@ -258,8 +258,8 @@ static NSNotificationQueue *defaultQueue = nil; /* Inserting and Removing Notifications From a Queue */ -- (void)dequeueNotificationsMatching:(NSNotification*)notification - coalesceMask:(NSNotificationCoalescing)coalesceMask +- (void)dequeueNotificationsMatching:(NSNotification *)notification + coalesceMask:(unsigned int)coalesceMask /* NSNotificationCoalescing */ { NSNotificationQueueRegistration* item; NSNotificationQueueRegistration* next; @@ -270,34 +270,30 @@ static NSNotificationQueue *defaultQueue = nil; for (item = self->asapQueue->tail; item; item=next) { next = item->next; if ((coalesceMask & NSNotificationCoalescingOnName) - && [name isEqual:item->name]) - { - remove_from_queue(self->asapQueue, item, self->zone); - continue; - } + && [name isEqual:item->name]) { + remove_from_queue(self->asapQueue, item, self->zone); + continue; + } if ((coalesceMask & NSNotificationCoalescingOnSender) - && (object == item->object)) - { - remove_from_queue(self->asapQueue, item, self->zone); - continue; - } + && (object == item->object)) { + remove_from_queue(self->asapQueue, item, self->zone); + continue; + } } // find in idle notification in queue for (item = self->idleQueue->tail; item; item=next) { next = item->next; if ((coalesceMask & NSNotificationCoalescingOnName) - && [name isEqual:item->name]) - { - remove_from_queue(self->asapQueue, item, self->zone); - continue; - } + && [name isEqual:item->name]) { + remove_from_queue(self->asapQueue, item, self->zone); + continue; + } if ((coalesceMask & NSNotificationCoalescingOnSender) - && (object == item->object)) - { - remove_from_queue(self->asapQueue, item, self->zone); - continue; - } + && (object == item->object)) { + remove_from_queue(self->asapQueue, item, self->zone); + continue; + } } } @@ -313,11 +309,12 @@ static NSNotificationQueue *defaultQueue = nil; else { int i; - for (i = [modes count]-1; i >= 0; i--) + for (i = [modes count]-1; i >= 0; i--) { if ([mode isEqual:[modes objectAtIndex:i]]) { ok = YES; break; } + } } // if mode is valid then post @@ -337,17 +334,17 @@ static NSNotificationQueue *defaultQueue = nil; forModes:nil]; } -- (void)enqueueNotification:(NSNotification*)notification +- (void)enqueueNotification:(NSNotification *)notification postingStyle:(NSPostingStyle)postingStyle - coalesceMask:(NSNotificationCoalescing)coalesceMask - forModes:(NSArray*)modes + coalesceMask:(unsigned int)coalesceMask /* NSNotificationCoalescing */ + forModes:(NSArray *)modes { /* note: this is called in UnixSignalHandler (no malloc allowed) */ if (coalesceMask != NSNotificationNoCoalescing) { [self dequeueNotificationsMatching:notification coalesceMask:coalesceMask]; } - + NSAssert(notification, @"missing notification ..."); switch (postingStyle) { diff --git a/libFoundation/Foundation/NSNull.m b/libFoundation/Foundation/NSNull.m index ceb197fa..dacb2708 100644 --- a/libFoundation/Foundation/NSNull.m +++ b/libFoundation/Foundation/NSNull.m @@ -33,38 +33,44 @@ static NSNull *sharedNSNull = nil; + (void)initialize { - if (sharedNSNull == nil) - sharedNSNull = (NSNull*)NSAllocateObject(self, 0, NSDefaultMallocZone()); + if (sharedNSNull == nil) { + sharedNSNull = (NSNull *) + NSAllocateObject(self, 0, NSDefaultMallocZone()); + } } -+ (id)null ++ (NSNull *)null { - return sharedNSNull; + return sharedNSNull; } + (id)allocWithZone:(NSZone *)_zone { - return sharedNSNull; + return sharedNSNull; } + (id)alloc { - return sharedNSNull; + return sharedNSNull; } - (void)dealloc { - NSLog(@"WARNING: tried to deallocate NSNull !"); + NSLog(@"WARNING: tried to deallocate NSNull !"); + + /* this is to please gcc 4.1 which otherwise issues a warning (and we + don't know the -W option to disable it, let me know if you do ;-)*/ + if (0) [super dealloc]; } /* NSCoding */ - (id)initWithCoder:(NSCoder *)aDecoder { - if (self == sharedNSNull) - return sharedNSNull; + if (self == sharedNSNull) + return sharedNSNull; - RELEASE(self); - return sharedNSNull; + RELEASE(self); + return sharedNSNull; } - (void)encodeWithCoder:(NSCoder *)aCoder @@ -75,56 +81,63 @@ static NSNull *sharedNSNull = nil; - (id)copy { - return RETAIN(self); + return RETAIN(self); } - (id)copyWithZone:(NSZone *)zone { - return RETAIN(self); + return RETAIN(self); } - (id)retain { - return self; + return self; } - (void)release { } - (id)autorelease { - return self; + return self; } /* comparison */ - (NSComparisonResult)compare:(id)_otherObject { - return (_otherObject == self) - ? NSOrderedSame - : NSOrderedDescending; + return (_otherObject == self) + ? NSOrderedSame + : NSOrderedDescending; } - (BOOL)boolValue { - return NO; + return NO; } - (NSString *)description { - return @""; + return @""; } - (NSString *)stringValue { - return @""; + return @""; } - (NSString *)stringRepresentation { /* encode as empty string in property lists ! */ #if DEBUG - NSLog(@"WARNING(%s): encoded NSNull in property list !", - __PRETTY_FUNCTION__); + NSLog(@"WARNING(%s): encoded NSNull in property list !", + __PRETTY_FUNCTION__); #endif - return @"\"\""; + return @"\"\""; } @end /* NSNull */ + +/* + Local Variables: + c-basic-offset: 4 + tab-width: 8 + End: +*/ diff --git a/libFoundation/Foundation/NSNumber.m b/libFoundation/Foundation/NSNumber.m index 478b6050..09e0345b 100644 --- a/libFoundation/Foundation/NSNumber.m +++ b/libFoundation/Foundation/NSNumber.m @@ -121,7 +121,7 @@ static inline NSIntNumber *makeInt(int i) return value ? RETAIN(boolYes) : RETAIN(boolNo); } -- (id)initWithChar:(char)value +- (id)initWithChar:(signed char)value { (void)AUTORELEASE(self); return [[NSCharNumber alloc] initValue:&value withObjCType:NULL]; @@ -204,7 +204,7 @@ static inline NSIntNumber *makeInt(int i) + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject((self == [NSNumber class]) - ? [NSTemporaryNumber class] : self, + ? [NSTemporaryNumber class] : (Class)self, 0, zone); } @@ -251,7 +251,7 @@ static inline NSIntNumber *makeInt(int i) return value ? boolYes : boolNo; } -+ (NSNumber*)numberWithChar:(char)value ++ (NSNumber*)numberWithChar:(signed char)value { return AUTORELEASE([[NSCharNumber alloc] initValue:&value withObjCType:NULL]); @@ -328,7 +328,7 @@ static inline NSIntNumber *makeInt(int i) return nil; } -- (id)initWithChar:(char)value +- (id)initWithChar:(signed char)value { [self shouldNotImplement:_cmd]; return nil; @@ -443,7 +443,7 @@ static inline NSIntNumber *makeInt(int i) return 0; } -- (char)charValue +- (signed char)charValue { [self subclassResponsibility:_cmd]; return 0; diff --git a/libFoundation/Foundation/NSNumberFormatter.m b/libFoundation/Foundation/NSNumberFormatter.m index 400c3a15..ccf81dfd 100644 --- a/libFoundation/Foundation/NSNumberFormatter.m +++ b/libFoundation/Foundation/NSNumberFormatter.m @@ -159,7 +159,8 @@ static inline const char *index(const char *cstr, char c) { } - (NSString *)negativeFormat { - return self->negativeFormat ? self->negativeFormat : negDefaultFormat; + return self->negativeFormat != nil + ? self->negativeFormat : (NSString *)negDefaultFormat; } - (void)setPositiveFormat:(NSString *)_format @@ -167,13 +168,14 @@ static inline const char *index(const char *cstr, char c) { _checkFormat(self, _format); if (self->positiveFormat != _format) { - RELEASE(self->positiveFormat); + RELEASE(self->positiveFormat); self->positiveFormat = nil; self->positiveFormat = [_format copyWithZone:[self zone]]; } } - (NSString *)positiveFormat { - return self->positiveFormat ? self->positiveFormat : posDefaultFormat; + return self->positiveFormat + ? self->positiveFormat : (NSString *)posDefaultFormat; } - (NSString *)zeroFormat { @@ -323,7 +325,7 @@ static inline const char *index(const char *cstr, char c) { { register const unsigned char *cfmt; hasThousandSep = NO; - if ((cfmt = [format cString])) { + if ((cfmt = (const unsigned char *)[format cString]) != NULL) { for ( ; *cfmt != '\0' && !hasThousandSep; cfmt++) { if (*cfmt == self->thousandSeparator) hasThousandSep = YES; diff --git a/libFoundation/Foundation/NSObject.m b/libFoundation/Foundation/NSObject.m index 568bad48..0cb99dfa 100644 --- a/libFoundation/Foundation/NSObject.m +++ b/libFoundation/Foundation/NSObject.m @@ -57,7 +57,7 @@ extern NSRecursiveLock* libFoundationLock; SEL selector; } + holderForTarget:(id)target argument:(id)argument selector:(SEL)action; -- (BOOL)isEqual:anotherHolder; +- (BOOL)isEqual:(_NSObjectDelayedExecutionHolder *)anotherHolder; - (void)execute; @end @@ -79,7 +79,7 @@ extern NSRecursiveLock* libFoundationLock; return [(NSObject *)self->target hash]; } -- (BOOL)isEqual:(_NSObjectDelayedExecutionHolder*)anotherHolder +- (BOOL)isEqual:(_NSObjectDelayedExecutionHolder *)anotherHolder { return [(NSObject *)self->target isEqual:anotherHolder->target] && [(NSObject *)self->argument isEqual:anotherHolder->argument] @@ -100,6 +100,13 @@ Class lfNSZoneClass = Nil; /* cache NSZone class */ static BOOL objc_runtime_exception(id object, int code, const char* fmt, va_list ap) { +#if 0 +# warning TEST LOG, REMOVE ME! + printf("ObjC: object=0x%p code=%i\n", object, code); + if (fmt != NULL) + vprintf(fmt, ap); +#endif + [[[ObjcRuntimeException alloc] initWithFormat: @"Objective-C runtime error: %@", Avsprintf([NSString stringWithCString:fmt], ap)] raise]; @@ -160,7 +167,7 @@ static NSMutableDictionary* delayedExecutions = nil; - (void)gcFinalize { #if 1 - fprintf(stderr, "finalize 0x%08X<%s>\n", + fprintf(stderr, "finalize 0x%p<%s>\n", self, ((*(Class *)self != NULL) ? (*(Class *)self)->name : "NULL")); fflush(stderr); @@ -350,8 +357,9 @@ static NSMutableDictionary* delayedExecutions = nil; return nil; mth = class_get_instance_method(self, aSelector); - return mth ? [NSMethodSignature signatureWithObjCTypes:mth->method_types] - : nil; + return mth + ? [NSMethodSignature signatureWithObjCTypes:mth->method_types] + : (NSMethodSignature *)nil; } - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector @@ -609,7 +617,7 @@ static NSMutableDictionary* delayedExecutions = nil; - (id)performSelector:(SEL)aSelector withObject:(id)anObject { struct objc_method *mth; - const unsigned char *argType; + const char *argType; if (aSelector == NULL) { [[[ObjcRuntimeException alloc] diff --git a/libFoundation/Foundation/NSObjectAllocation.m b/libFoundation/Foundation/NSObjectAllocation.m index 2d63a80c..fee44ca6 100644 --- a/libFoundation/Foundation/NSObjectAllocation.m +++ b/libFoundation/Foundation/NSObjectAllocation.m @@ -198,8 +198,8 @@ void _check_object_for_leak(void *memory, void *cd) } if ((rc >= 1) && (rc <= 1000)) { - fprintf(stderr, "LEAK(rc=%d): 0x%08X<%s>", - rc, (unsigned)object, (class ? class->name : "Nil")); + fprintf(stderr, "LEAK(rc=%d): 0x%p<%s>", + rc, object, (class ? class->name : "Nil")); if ([object isKindOfClass:[NSString class]]) { unsigned slen = [object cStringLength]; @@ -287,12 +287,12 @@ NSObject *NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone) aClass->instance_size + extraBytes; if (logAlloc) { fprintf(logAlloc, - "alloc-#: 0x%08X<%s> size=%d (%d + %d) zone=0x%08X\n", - (unsigned)p, class_get_class_name(aClass), + "alloc-#: 0x%p<%s> size=%d (%d + %d) zone=0x%p\n", + p, class_get_class_name(aClass), (unsigned)(sizeof(struct HashObjectLayout) + aClass->instance_size + extraBytes), (unsigned)aClass->instance_size, (unsigned)extraBytes, - (unsigned)zone); + zone); } #endif return (NSObject*)p; @@ -321,13 +321,13 @@ NSObject *NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone) aClass->instance_size + extraBytes); fprintf(logAlloc, - "alloc-rc: 0x%08X<%s> size=%d (%d + %d) zone=0x%08X\n", - (unsigned)&(p->class_pointer), + "alloc-rc: 0x%p<%s> size=%d (%d + %d) zone=0x%p\n", + &(p->class_pointer), aClass ? class_get_class_name(aClass) : "Nil", size, (unsigned)aClass->instance_size, (unsigned)extraBytes, - (unsigned)zone); + zone); } #endif return (NSObject*)(&(p->class_pointer)); @@ -379,7 +379,7 @@ void NSDeallocateObject(NSObject *anObject) #endif #if LIB_FOUNDATION_BOEHM_GC - fprintf(stderr, "WARNING: explicit free of GC object 0x%08X !\n", anObject); + fprintf(stderr, "WARNING: explicit free of GC object 0x%p !\n",anObject); abort(); GC_FREE(anObject); anObject = nil; return; @@ -387,8 +387,8 @@ void NSDeallocateObject(NSObject *anObject) #if DEBUG if (logAlloc) { - fprintf(logAlloc, "dealloc: 0x%08X<%s>\n", - (unsigned)anObject, + fprintf(logAlloc, "dealloc: 0x%p<%s>\n", + anObject, class_get_class_name(((id)anObject)->class_pointer)); } #endif @@ -426,7 +426,7 @@ void NSDeallocateObject(NSObject *anObject) NSZoneFree(NSZoneFromPointer(p), p); #if 0 - fprintf(stderr, "deallocated: 0x%08X\n", anObject); + fprintf(stderr, "deallocated: 0x%p\n", anObject); #endif anObject = nil; p = nil; #endif diff --git a/libFoundation/Foundation/NSObjectInvocation.m b/libFoundation/Foundation/NSObjectInvocation.m index 055e0224..347b382c 100644 --- a/libFoundation/Foundation/NSObjectInvocation.m +++ b/libFoundation/Foundation/NSObjectInvocation.m @@ -66,7 +66,8 @@ typedef id (*mId_Id10) (id, SEL, id, id, id, id, id, id, id, id, id, id); + (id)allocForArgumentCount:(int)_count zone:(NSZone *)_zone { - NSObjectInvocation *i = NSAllocateObject(self, _count * sizeof(id), _zone); + NSObjectInvocation *i = (NSObjectInvocation *) + NSAllocateObject(self, _count * sizeof(id), _zone); i->argumentCount = _count; return i; } diff --git a/libFoundation/Foundation/NSPathUtilities.m b/libFoundation/Foundation/NSPathUtilities.m index 07682d4a..446b8d42 100644 --- a/libFoundation/Foundation/NSPathUtilities.m +++ b/libFoundation/Foundation/NSPathUtilities.m @@ -507,7 +507,7 @@ static NSString *rootPath = @"/"; ([self length] ? [str stringByAppendingString:aString] : aString)] - : AUTORELEASE([self copyWithZone:[self zone]]); + : (NSString *)AUTORELEASE([self copyWithZone:[self zone]]); } - (NSArray *)stringsByAppendingPaths:(NSArray *)paths @@ -529,7 +529,7 @@ static NSString *rootPath = @"/"; return [aString length] ? [self stringByAppendingString: [extensionSeparator stringByAppendingString:aString]] - : AUTORELEASE([self copyWithZone:[self zone]]); + : (NSString *)AUTORELEASE([self copyWithZone:[self zone]]); } - (NSString *)stringByDeletingLastPathComponent @@ -653,7 +653,7 @@ static NSString *rootPath = @"/"; __PRETTY_FUNCTION__); return nil; } - if (!resolve_symlinks_in_path(source, resolved)) { + if (!resolve_symlinks_in_path(source, (char *)resolved)) { /* previously returned 'nil', which is wrong according to MacOSXS Spec @@ -664,7 +664,7 @@ static NSString *rootPath = @"/"; return self; #endif } - return [NSString stringWithCString:resolved]; + return [NSString stringWithCString:(char *)resolved]; #endif } diff --git a/libFoundation/Foundation/NSPredicateParser.m b/libFoundation/Foundation/NSPredicateParser.m index 66e76364..159f8b19 100644 --- a/libFoundation/Foundation/NSPredicateParser.m +++ b/libFoundation/Foundation/NSPredicateParser.m @@ -107,9 +107,10 @@ static NSString *_parseOp(const char *_buf, unsigned _bufLen, NSMapTable *predicateCache; } -- (NSDictionary *)resultForFunction:(NSString *)_fct atPos:(unsigned)_pos; +- (NSDictionary *)resultForFunction:(NSString *)_fct + atPos:(unsigned long)_pos; - (void)setResult:(NSDictionary *)_dict forFunction:(NSString *)_fct - atPos:(unsigned)_pos; + atPos:(unsigned long)_pos; - (id)getObjectFromStackFor:(char)_c; @end @@ -250,18 +251,25 @@ static NSString *_parseOp(const char *_buf, unsigned _bufLen, [super dealloc]; } -- (NSDictionary *)resultForFunction:(NSString *)_fct atPos:(unsigned)_pos +- (NSDictionary *)resultForFunction:(NSString *)_fct atPos:(unsigned long)_p { - return NSMapGet(self->predicateCache, - [StringClass stringWithFormat:@"%@_%d", _fct, _pos]); + NSDictionary *r; + NSString *k; + + k = [[StringClass alloc] initWithFormat:@"%@_%ld", _fct, _p]; + r = NSMapGet(self->predicateCache, k); + [k release]; + return r; } - (void)setResult:(NSDictionary *)_dict forFunction:(NSString *)_fct - atPos:(unsigned)_pos + atPos:(unsigned long)_pos { - NSMapInsert(self->predicateCache, - [StringClass stringWithFormat:@"%@_%d", _fct, _pos], - _dict); + NSString *k; + + k = [[StringClass alloc] initWithFormat:@"%@_%ld", _fct, _pos]; + NSMapInsert(self->predicateCache, k, _dict); + [k release]; } - (id)getObjectFromStackFor:(char)_c { @@ -580,7 +588,8 @@ static NSPredicate *_parseKeyCompPredicate(id _ctx, const char *_buf, unsigned pos = 0; BOOL valueIsKey = NO; - dict = [_ctx resultForFunction:@"parseKeyCompPredicate" atPos:(unsigned)_buf]; + dict = [_ctx resultForFunction:@"parseKeyCompPredicate" + atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) NSLog(@"_parseKeyCompQual return <%@> [cached] for <%s> ", dict, _buf); @@ -649,7 +658,7 @@ static NSPredicate *_parseKeyCompPredicate(id _ctx, const char *_buf, [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] forFunction:@"parseKeyCompPredicate" - atPos:(unsigned)_buf]; + atPos:(unsigned long)_buf]; *_predLen = pos; } return qual; @@ -726,10 +735,11 @@ static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen, char c = 0; if (_bufLen == 0) { - if (qDebug) NSLog(@"%s: _bufLen == 0 --> return nil", __PRETTY_FUNCTION__); + if (qDebug) + NSLog(@"%s: _bufLen == 0 --> return nil", __PRETTY_FUNCTION__); return nil; } - dict = [_ctx resultForFunction:@"parseKey" atPos:(unsigned)_buf]; + dict = [_ctx resultForFunction:@"parseKey" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) { NSLog(@"%s: return <%@> [cached] for <%s> ", __PRETTY_FUNCTION__, @@ -803,7 +813,7 @@ static NSString *_parseKey(id _ctx, const char *_buf, unsigned _bufLen, [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] forFunction:@"parseKey" - atPos:(unsigned)_buf]; + atPos:(unsigned long)_buf]; *_keyLen = pos; } return result; @@ -826,7 +836,7 @@ static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, return nil; } - dict = [_ctx resultForFunction:@"parseValue" atPos:(unsigned)_buf]; + dict = [_ctx resultForFunction:@"parseValue" atPos:(unsigned long)_buf]; if (dict != nil) { if (qDebug) { NSLog(@"_parseKeyCompPredicate return <%@> [cached] for <%s> ", @@ -1075,7 +1085,7 @@ static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, if (qDebug) { NSLog(@"%s: return <%@> for <%s> ", __PRETTY_FUNCTION__, - obj?obj:@"", _buf); + obj != nil ? obj : (id)@"", _buf); } if (obj != nil) { @@ -1086,7 +1096,7 @@ static id _parseValue(id _ctx, const char *_buf, unsigned _bufLen, [_ctx setResult: [NSDictionary dictionaryWithObjects:values forKeys:keys count:2] - forFunction:@"parseValue" atPos:(unsigned)_buf]; + forFunction:@"parseValue" atPos:(unsigned long)_buf]; *_keyLen = pos; } return obj; diff --git a/libFoundation/Foundation/NSRunLoop.m b/libFoundation/Foundation/NSRunLoop.m index 51d506bb..d99be8c1 100644 --- a/libFoundation/Foundation/NSRunLoop.m +++ b/libFoundation/Foundation/NSRunLoop.m @@ -134,13 +134,19 @@ static char *activityDesc[8] = { - (void)dealloc { - RELEASE(self->fileObject); self->fileObject = nil; + RELEASE(self->fileObject); [super dealloc]; } -- (BOOL)isEqual:(NSRunLoopFileObjectInfo*)otherInfo +- (BOOL)isEqual:(id)otherInfo { - return [self->fileObject isEqual:otherInfo->fileObject]; + if (otherInfo == nil) + return NO; + if (*(Class *)self != *(Class *)otherInfo) /* check class */ + return NO; + + return [self->fileObject isEqual: + ((NSRunLoopFileObjectInfo *)otherInfo)->fileObject]; } - (BOOL)isAlive { @@ -191,7 +197,7 @@ static char *activityDesc[8] = { - (NSString *)description { return [NSString stringWithFormat: - @"<%@[0x%08X]: object=%@ actitivity=%s>", + @"<%@[0x%p]: object=%@ actitivity=%s>", NSStringFromClass([self class]), self, self->fileObject, activityDesc[self->watchedActivities] @@ -286,8 +292,15 @@ static char *activityDesc[8] = { return [(NSObject *)self->target hash]; } -- (BOOL)isEqual:(NSRunLoopActionHolder*)anotherHolder +- (BOOL)isEqual:(id)otherObject { + NSRunLoopActionHolder *anotherHolder; + + if ((anotherHolder = otherObject) == nil) + return NO; + if (![anotherHolder isKindOfClass:[NSRunLoopActionHolder class]]) + return NO; + return [self->target isEqual:anotherHolder->target] && [argument isEqual:anotherHolder->argument] && SEL_EQ(self->action, anotherHolder->action); @@ -575,11 +588,11 @@ static int compare_fire_dates(id timer1, id timer2, void* userData) /* Sort the timers based on their fire date */ [timers sortUsingFunction:compare_fire_dates context:NULL]; - return [timers count] ? [[timers objectAtIndex:0] fireDate] : nil; + return [timers count] > 0 + ? [[timers objectAtIndex:0] fireDate] : (NSDate *)nil; } -- (void)addTimer:(NSTimer*)aTimer - forMode:(NSString*)aMode +- (void)addTimer:(NSTimer *)aTimer forMode:(NSString *)aMode { [_getInputManager(self, aMode) addTimer:aTimer]; } @@ -589,7 +602,7 @@ static int compare_fire_dates(id timer1, id timer2, void* userData) id inputManager, fileObjects; NSArray *timers; NSDate *date; - + /* Retain the limitDate so it doesn't get released by limitDateForMode: if it fires a timer that has as fireDate the limitDate. (bug report from Benhur Stein ) @@ -848,7 +861,7 @@ static int compare_fire_dates(id timer1, id timer2, void* userData) /* Monitoring file objects */ - (void)addFileObject:(id)_fileObject - activities:(NSPosixFileActivities)_activities + activities:(unsigned int)_activities /* NSPosixFileActivities */ forMode:(NSString *)_mode { [_getInputManager(self, _mode) addFileObject:_fileObject diff --git a/libFoundation/Foundation/NSSet.m b/libFoundation/Foundation/NSSet.m index be3a949c..524fc5e2 100644 --- a/libFoundation/Foundation/NSSet.m +++ b/libFoundation/Foundation/NSSet.m @@ -48,7 +48,7 @@ + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject( (self == [NSSet class]) ? - [NSConcreteSet class] : self, 0, zone); + [NSConcreteSet class] : (Class)self, 0, zone); } + (id)set @@ -463,7 +463,8 @@ + (id)allocWithZone:(NSZone*)zone { return NSAllocateObject( (self == [NSMutableSet class]) ? - [NSConcreteMutableSet class] : self, 0, zone); + [NSConcreteMutableSet class] : (Class)self, + 0, zone); } + (id)setWithCapacity:(unsigned)numItems diff --git a/libFoundation/Foundation/NSString+StringEncoding.m b/libFoundation/Foundation/NSString+StringEncoding.m index a95e4ab7..4560d712 100644 --- a/libFoundation/Foundation/NSString+StringEncoding.m +++ b/libFoundation/Foundation/NSString+StringEncoding.m @@ -1002,7 +1002,7 @@ id NSInitStringWithData(NSString *self, NSData *data, } case NSASCIIStringEncoding: case NSISOLatin1StringEncoding: { - self = [self initWithCString:buf length:len]; + self = [self initWithCString:(char *)buf length:len]; lfFree(buf); return self; } diff --git a/libFoundation/Foundation/NSString.m b/libFoundation/Foundation/NSString.m index 9420c889..b27536f7 100644 --- a/libFoundation/Foundation/NSString.m +++ b/libFoundation/Foundation/NSString.m @@ -1376,9 +1376,9 @@ static Class NSStringClass = Nil; if (NSTemporaryStringClass == Nil) NSTemporaryStringClass = [NSTemporaryString class]; - return (self == NSStringClass) ? - [NSTemporaryStringClass allocWithZone:zone] - : NSAllocateObject(self, 0, zone); + return (self == NSStringClass) + ? [NSTemporaryStringClass allocWithZone:zone] + : (id)NSAllocateObject(self, 0, zone); } + (id)localizedStringWithFormat:(NSString*)format,... @@ -1485,14 +1485,14 @@ static Class NSStringClass = Nil; { return ([self hasPrefix:_prefix]) ? [self substringFromIndex:[_prefix length]] - : [[self copy] autorelease]; + : (NSString *)[[self copy] autorelease]; } - (NSString *)stringWithoutSuffix:(NSString *)_suffix { return ([self hasSuffix:_suffix]) ? [self substringToIndex:([self length] - [_suffix length])] - : [[self copy] autorelease]; + : (NSString *)[[self copy] autorelease]; } - (NSString *)stringByReplacingString:(NSString *)_orignal @@ -1642,9 +1642,9 @@ static BOOL (*isWhiteSpaceSetMem)(id, SEL, unichar); + (id)allocWithZone:(NSZone *)zone { - return (self == [NSMutableString class]) ? - [NSMutableTemporaryString allocWithZone:zone] - : NSAllocateObject(self, 0, zone); + return (self == [NSMutableString class]) + ? [NSMutableTemporaryString allocWithZone:zone] + : (id)NSAllocateObject(self, 0, zone); } + (id)stringWithCapacity:(unsigned int)capacity @@ -1976,6 +1976,10 @@ static Class NSShortInline8BitStringClass = Nil; fprintf (stderr, "ERROR: NSTemporaryString %s to be deallocated!\n", isa->name); abort (); + + /* this is to please gcc 4.1 which otherwise issues a warning (and we + don't know the -W option to disable it, let me know if you do ;-)*/ + if (0) [super dealloc]; } static inline void _collectTemporary(NSTemporaryString *self) @@ -2612,6 +2616,10 @@ static NSMutableTemporaryString *temporaryMutableStringsPool = nil; { fprintf(stderr,"NSMutableTemporaryString %s to be deallocated!\n",isa->name); abort(); + + /* this is to please gcc 4.1 which otherwise issues a warning (and we + don't know the -W option to disable it, let me know if you do ;-)*/ + if (0) [super dealloc]; } static inline void _collectMutableTemporary(NSMutableTemporaryString *self) diff --git a/libFoundation/Foundation/NSTask.m b/libFoundation/Foundation/NSTask.m index 32214432..a52f7c45 100644 --- a/libFoundation/Foundation/NSTask.m +++ b/libFoundation/Foundation/NSTask.m @@ -53,8 +53,10 @@ NSString *NSTaskDidTerminateNotification = @"NSTaskDidTerminateNotification"; + (id)allocWithZone:(NSZone*)zone { - NSTask *task = NSAllocateObject((self == [NSTask class]) ? - [NSConcreteTask class] : self, 0, zone); + NSTask *task = (NSTask *) + NSAllocateObject((self == [NSTask class]) + ? [NSConcreteTask class] : (Class)self, + 0, zone); return task; } diff --git a/libFoundation/Foundation/NSThread.m b/libFoundation/Foundation/NSThread.m index d3b5b544..0cc6c8e5 100644 --- a/libFoundation/Foundation/NSThread.m +++ b/libFoundation/Foundation/NSThread.m @@ -76,6 +76,14 @@ too often. */ +@interface NSException(UsedPrivates) ++ (void)taskNowMultiThreaded:(NSNotification *)_notification; +@end + +@interface NSNotificationCenter(UsedPrivates) ++ (void)taskNowMultiThreaded:(NSNotification *)_notification; +@end + /* NSThread notifications */ LF_DECLARE NSString* NSWillBecomeMultiThreadedNotification = diff --git a/libFoundation/Foundation/NSTimeZone.m b/libFoundation/Foundation/NSTimeZone.m index 44abb028..1d348ad1 100644 --- a/libFoundation/Foundation/NSTimeZone.m +++ b/libFoundation/Foundation/NSTimeZone.m @@ -101,7 +101,7 @@ static NSTimeZone *localTimeZone = nil; didInit = YES; { - id regionsDictionary; + NSDictionary *regionsDictionary; id regionsFile = nil; NSString *offset; NSEnumerator *enumerator; @@ -291,7 +291,7 @@ static NSTimeZone *localTimeZone = nil; NSTimeZoneDetail* detail; NSTimeZone* timeZone; int i, j, count1, count2; - unsigned char buf[16]; + char buf[16]; hours = abs (seconds) / 3600; minutes = (abs (seconds) - hours * 3600) / 60; diff --git a/libFoundation/Foundation/NSURL.m b/libFoundation/Foundation/NSURL.m index ea341ecb..53cfae2f 100644 --- a/libFoundation/Foundation/NSURL.m +++ b/libFoundation/Foundation/NSURL.m @@ -977,7 +977,7 @@ static Class _NSRelativeURLClass = Nil; if ((self = [super initWithScheme:_scheme host:_host path:_path])) { self->host = [_host copy]; - self->path = [_path length] > 0 ? [_path copy] : @"/"; + self->path = [_path length] > 0 ? [_path copy] : (id)@"/"; } return self; } @@ -999,7 +999,7 @@ static Class _NSRelativeURLClass = Nil; { return self->port > 0 ? [NSNumber numberWithUnsignedInt:self->port] - : nil; + : (NSNumber *)nil; } - (NSString *)fragment @@ -1233,7 +1233,7 @@ static Class _NSRelativeURLClass = Nil; if ((self = [super initWithScheme:_scheme host:_host path:_path])) { self->scheme = [_scheme copy]; self->host = [_host copy]; - self->path = [_path length] > 0 ? [_path copy] : @"/"; + self->path = [_path length] > 0 ? [_path copy] : (id)@"/"; } return self; } @@ -1256,7 +1256,7 @@ static Class _NSRelativeURLClass = Nil; { return self->port > 0 ? [NSNumber numberWithUnsignedInt:self->port] - : nil; + : (NSNumber *)nil; } - (NSString *)fragment diff --git a/libFoundation/Foundation/NSUserDefaults.m b/libFoundation/Foundation/NSUserDefaults.m index 2f69b69a..24a2371d 100644 --- a/libFoundation/Foundation/NSUserDefaults.m +++ b/libFoundation/Foundation/NSUserDefaults.m @@ -256,7 +256,8 @@ LF_DECLARE NSString *NSNegativeCurrencyFormatString = @"NSNegativeCurrencyFormat - (void)removeObjectForKey:(NSString*)defaultName { - NSMutableDictionary *domain = [self persistentDomainForName:appDomain]; + NSMutableDictionary *domain = (NSMutableDictionary *) + [self persistentDomainForName:appDomain]; [domain removeObjectForKey:defaultName]; [self persistentDomainHasChanged:appDomain]; } @@ -599,7 +600,7 @@ static NSString* sharedDefaultsDir = nil; if (sharedDefaults == nil) { if (sharedDefaultsDir) { sharedDefaults = (id) - [[NSSharedUserDefaults alloc] + [(NSSharedUserDefaults *)[NSSharedUserDefaults alloc] initWithPath:sharedDefaultsDir]; } else { @@ -647,7 +648,8 @@ static NSString* sharedDefaultsDir = nil; #endif sharedDefaults = (id) - [[NSSharedUserDefaults alloc] initWithPath:defdir]; + [(NSSharedUserDefaults *)[NSSharedUserDefaults alloc] + initWithPath:defdir]; } [sharedDefaults makeStandardDomainSearchList]; } diff --git a/libFoundation/Foundation/NSValue.h b/libFoundation/Foundation/NSValue.h index b4021131..78463bfd 100644 --- a/libFoundation/Foundation/NSValue.h +++ b/libFoundation/Foundation/NSValue.h @@ -31,7 +31,7 @@ @class NSString; @class NSDictionary; -@interface NSValue : NSObject +@interface NSValue : NSObject < NSCopying, NSCoding > // Internal method to determine concrete value class @@ -80,29 +80,29 @@ // Allocating and Initializing - (id)initWithBool:(BOOL)value; -- (id)initWithChar:(char)value; +- (id)initWithChar:(signed char)value; - (id)initWithUnsignedChar:(unsigned char)value; -- (id)initWithShort:(short)value; +- (id)initWithShort:(signed short)value; - (id)initWithUnsignedShort:(unsigned short)value; -- (id)initWithInt:(int)value; +- (id)initWithInt:(signed int)value; - (id)initWithUnsignedInt:(unsigned int)value; -- (id)initWithLong:(long)value; +- (id)initWithLong:(signed long)value; - (id)initWithUnsignedLong:(unsigned long)value; -- (id)initWithLongLong:(long long)value; +- (id)initWithLongLong:(signed long long)value; - (id)initWithUnsignedLongLong:(unsigned long long)value; - (id)initWithFloat:(float)value; - (id)initWithDouble:(double)value; + (NSNumber*)numberWithBool:(BOOL)value; -+ (NSNumber*)numberWithChar:(char)value; ++ (NSNumber*)numberWithChar:(signed char)value; + (NSNumber*)numberWithUnsignedChar:(unsigned char)value; -+ (NSNumber*)numberWithShort:(short)value; ++ (NSNumber*)numberWithShort:(signed short)value; + (NSNumber*)numberWithUnsignedShort:(unsigned short)value; -+ (NSNumber*)numberWithInt:(int)value; ++ (NSNumber*)numberWithInt:(signed int)value; + (NSNumber*)numberWithUnsignedInt:(unsigned int)value; -+ (NSNumber*)numberWithLong:(long)value; ++ (NSNumber*)numberWithLong:(signed long)value; + (NSNumber*)numberWithUnsignedLong:(unsigned long)value; -+ (NSNumber*)numberWithLongLong:(long long)value; ++ (NSNumber*)numberWithLongLong:(signed long long)value; + (NSNumber*)numberWithUnsignedLongLong:(unsigned long long)value; + (NSNumber*)numberWithFloat:(float)value; + (NSNumber*)numberWithDouble:(double)value; @@ -110,24 +110,24 @@ // Accessing Data - (BOOL)boolValue; -- (char)charValue; +- (signed char)charValue; - (unsigned char)unsignedCharValue; -- (short)shortValue; +- (signed short)shortValue; - (unsigned short)unsignedShortValue; -- (int)intValue; +- (signed int)intValue; - (unsigned int)unsignedIntValue; -- (long)longValue; +- (signed long)longValue; - (unsigned long)unsignedLongValue; -- (long long)longLongValue; +- (signed long long)longLongValue; - (unsigned long long)unsignedLongLongValue; - (float)floatValue; - (double)doubleValue; // Converting to string -- (NSString*)stringValue; -- (NSString*)descriptionWithLocale:(NSDictionary*)locale; -- (NSString*)description; +- (NSString *)stringValue; +- (NSString *)descriptionWithLocale:(NSDictionary*)locale; +- (NSString *)description; // Comparing Data diff --git a/libFoundation/Foundation/NSZone.m b/libFoundation/Foundation/NSZone.m index fa1864ff..a8776ab7 100644 --- a/libFoundation/Foundation/NSZone.m +++ b/libFoundation/Foundation/NSZone.m @@ -96,7 +96,7 @@ static ZoneListNode* removeZoneFromList (NSZone* aZone) } /* curr should not be NULL, but who knows... */ - NSCAssert1(curr, @"curr zone node ptr is NULL (prev=0x%08X)", prev); + NSCAssert1(curr, @"curr zone node ptr is NULL (prev=0x%p)", prev); prev->next = curr->next; curr->next = NULL; @@ -301,6 +301,10 @@ static ZoneListNode* removeZoneFromList (NSZone* aZone) objc_free(node); objc_free(self); + + /* this is to please gcc 4.1 which otherwise issues a warning (and we + don't know the -W option to disable it, let me know if you do ;-)*/ + if (0) [super dealloc]; } - (oneway void)release diff --git a/libFoundation/Foundation/PrintfScannerHandler.m b/libFoundation/Foundation/PrintfScannerHandler.m index ed3f315d..78d36223 100644 --- a/libFoundation/Foundation/PrintfScannerHandler.m +++ b/libFoundation/Foundation/PrintfScannerHandler.m @@ -83,8 +83,8 @@ - (NSString*)convertString:(va_list*)pString scanner:(FormatScanner*)scanner { - char* string = va_arg(*pString, char*); - return string ? [NSString stringWithCString:string] : @""; + char *string = va_arg(*pString, char*); + return string ? [NSString stringWithCString:string] : (id)@""; } - (NSString*)convertFloat:(va_list*)pFloat scanner:(FormatScanner*)scanner diff --git a/libFoundation/Foundation/PrivateThreadData.m b/libFoundation/Foundation/PrivateThreadData.m index 1f8736e1..2050fa92 100644 --- a/libFoundation/Foundation/PrivateThreadData.m +++ b/libFoundation/Foundation/PrivateThreadData.m @@ -94,7 +94,7 @@ exceptionStack = handler; } -- (NSUncaughtExceptionHandler*)uncaughtExceptionHandler +- (NSUncaughtExceptionHandler *)uncaughtExceptionHandler { #ifdef BROKEN_COMPILER return uncaughtExceptionHandler; @@ -103,7 +103,7 @@ while (ex->previousHandler) ex = ex->previousHandler; - return ex->handler; + return (NSUncaughtExceptionHandler *)ex->handler; #endif } @@ -116,7 +116,7 @@ while (ex->previousHandler) ex = ex->previousHandler; - ex->handler = handler; + ex->handler = (THandlerFunction)handler; #endif } diff --git a/libFoundation/Foundation/PropertyListParser.m b/libFoundation/Foundation/PropertyListParser.m index 0452f33d..4901d7b8 100644 --- a/libFoundation/Foundation/PropertyListParser.m +++ b/libFoundation/Foundation/PropertyListParser.m @@ -634,7 +634,7 @@ static NSException *_makeException(NSException *_exception, forKey:@"lastLine"]; } else { - NSLog(@"%s: startPos=0x%08X endPos=0x%08X", + NSLog(@"%s: startPos=0x%p endPos=0x%p", __PRETTY_FUNCTION__, startPos, endPos); } } diff --git a/libFoundation/Foundation/PropertyListParserUnichar.m b/libFoundation/Foundation/PropertyListParserUnichar.m index 57a6dc6b..63a3b7b7 100644 --- a/libFoundation/Foundation/PropertyListParserUnichar.m +++ b/libFoundation/Foundation/PropertyListParserUnichar.m @@ -139,7 +139,7 @@ NSString *NSParseStringFromBuffer(const unsigned char *_buffer, unsigned _len) return nil; } - s = [[NSString alloc] initWithCString:_buffer length:_len]; + s = [[NSString alloc] initWithCString:(char *)_buffer length:_len]; result = NSParseStringFromString(s); [s release]; return result; @@ -157,7 +157,7 @@ NSArray *NSParseArrayFromBuffer(const unsigned char *_buffer, unsigned _len) return nil; } - s = [[NSString alloc] initWithCString:_buffer length:_len]; + s = [[NSString alloc] initWithCString:(char *)_buffer length:_len]; result = NSParseArrayFromString(s); [s release]; return result; @@ -176,7 +176,7 @@ NSDictionary *NSParseDictionaryFromBuffer(const unsigned char *_buffer, return nil; } - s = [[NSString alloc] initWithCString:_buffer length:_len]; + s = [[NSString alloc] initWithCString:(char *)_buffer length:_len]; result = NSParseDictionaryFromString(s); [s release]; return result; @@ -283,7 +283,7 @@ id NSParsePropertyListFromBuffer(const unsigned char *_buffer, unsigned _len) return nil; } - s = [[NSString alloc] initWithCString:_buffer length:_len]; + s = [[NSString alloc] initWithCString:(char *)_buffer length:_len]; result = NSParsePropertyListFromString(s); [s release]; return result; @@ -344,7 +344,7 @@ id NSParseStringsFromBuffer(const unsigned char *_buffer, unsigned _len) NSDictionary *result; NSString *s; - s = [[NSString alloc] initWithCString:_buffer length:_len]; + s = [[NSString alloc] initWithCString:(char *)_buffer length:_len]; result = NSParseStringsFromString(s); [s release]; return result; @@ -558,7 +558,7 @@ static NSException *_makeException(NSException *_exception, [s release]; } else { - NSLog(@"%s: startPos=0x%08X endPos=0x%08X", + NSLog(@"%s: startPos=0x%p endPos=0x%p", __PRETTY_FUNCTION__, startPos, endPos); } } diff --git a/libFoundation/Foundation/StackZone.m b/libFoundation/Foundation/StackZone.m index 24333b27..2ca4ad82 100644 --- a/libFoundation/Foundation/StackZone.m +++ b/libFoundation/Foundation/StackZone.m @@ -68,7 +68,7 @@ previous = previous->previous; } - NSCAssert(nextNode, @"nextNode is NULL (previous=0x%08X)", previous); + NSCAssert(nextNode, @"nextNode is NULL (previous=0x%p)", previous); /* Check if the requested size can be handled */ if (((char*)nextNode) + size - memory diff --git a/libFoundation/Foundation/UnixSignalHandler.m b/libFoundation/Foundation/UnixSignalHandler.m index 9755370c..fae0d74e 100644 --- a/libFoundation/Foundation/UnixSignalHandler.m +++ b/libFoundation/Foundation/UnixSignalHandler.m @@ -259,7 +259,7 @@ static RETSIGTYPE signalHandlerFunction (int signum) for (i = 0; i < NSIG; i++) { self->signalHandlers[i] = [[UnixSignalHandlerList alloc] init]; - //NSLog(@"handler 0x%08X %i: %@", self, i, self->signalHandlers[i]); + //NSLog(@"handler 0x%p %i: %@", self, i, self->signalHandlers[i]); } #if BSD_SIGNALS diff --git a/libFoundation/Foundation/fhs.make b/libFoundation/Foundation/fhs.make index 688d2f40..5c039b0e 100644 --- a/libFoundation/Foundation/fhs.make +++ b/libFoundation/Foundation/fhs.make @@ -27,7 +27,12 @@ ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ + +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib64/ +else FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +endif fhs-header-dirs :: $(MKDIRS) $(FHS_INCLUDE_DIR) diff --git a/libFoundation/Foundation/libFoundation.make.in b/libFoundation/Foundation/libFoundation.make.in index d38369a8..cf02c3d5 100644 --- a/libFoundation/Foundation/libFoundation.make.in +++ b/libFoundation/Foundation/libFoundation.make.in @@ -50,7 +50,8 @@ LIBFOUNDATION_HEADER_TARGET_FLAG = \ -I$(GNUSTEP_SYSTEM_ROOT)/Headers/libFoundation/$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(OBJC_RUNTIME) endif -AUXILIARY_CPPFLAGS += $(LIBFOUNDATION_HEADER_TARGET_FLAG) +AUXILIARY_CPPFLAGS += $(LIBFOUNDATION_HEADER_TARGET_FLAG) +AUXILIARY_OBJCFLAGS += -fconstant-string-class=NSConstantString # If gc=yes was passed and libFoundation was compiled with Boehm's # GC support, use the appropriate libraries diff --git a/libFoundation/GNUmakefile b/libFoundation/GNUmakefile index 967b2789..4b7b0f12 100644 --- a/libFoundation/GNUmakefile +++ b/libFoundation/GNUmakefile @@ -26,9 +26,9 @@ -include gsfix.make -ifeq ($(GNUSTEP_SYSTEM_ROOT),) +ifeq ($(GNUSTEP_MAKEFILES),) -$(warning ERROR: Your $(GNUSTEP_SYSTEM_ROOT) environment variable is empty !) +$(warning ERROR: Your $(GNUSTEP_MAKEFILES) environment variable is empty !) $(error Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh") else diff --git a/libFoundation/Resources/GNUmakefile b/libFoundation/Resources/GNUmakefile index 85c34eed..031eb9f4 100644 --- a/libFoundation/Resources/GNUmakefile +++ b/libFoundation/Resources/GNUmakefile @@ -20,11 +20,20 @@ # an action of contract, negligence or other tortious action, arising out of # or in connection with the use or performance of this software. +-include ../gsfix.make + +ifeq ($(GNUSTEP_MAKEFILES),) + +$(warning ERROR: Your $(GNUSTEP_MAKEFILES) environment variable is empty !) +$(error Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh") + +else + TOP = .. GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) --include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make +-include $(GNUSTEP_MAKEFILES)/common.make -include $(TOP)/Foundation/$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(OBJC_RUNTIME)/config.mak -include $(TOP)/config.mak @@ -122,3 +131,4 @@ uninstall: rm -rf $(addprefix $(INSTALL_DIR)/, \ CharacterSets TimeZoneInfo Defaults) +endif diff --git a/libFoundation/Version b/libFoundation/Version index c4e177c5..f46921f7 100644 --- a/libFoundation/Version +++ b/libFoundation/Version @@ -1,5 +1,6 @@ # version file MAJOR_VERSION:=1 -MINOR_VERSION:=0 -SUBMINOR_VERSION:=75 +MINOR_VERSION:=1 +SUBMINOR_VERSION:=3 + diff --git a/libFoundation/aclocal.m4 b/libFoundation/aclocal.m4 index 5faef8c1..6a8312fd 100644 --- a/libFoundation/aclocal.m4 +++ b/libFoundation/aclocal.m4 @@ -42,6 +42,7 @@ AC_CACHE_VAL(ac_cv_nested_functions, [AC_LANG_SAVE[]dnl AC_LANG_OBJECTIVE_C[] AC_TRY_RUN([ +#include f(void (*nested)()) { (*nested)(); @@ -81,6 +82,7 @@ AC_LANG_OBJECTIVE_C[] AC_TRY_RUN([ #include #include +#include void f() { diff --git a/libFoundation/config.guess b/libFoundation/config.guess index b11ea89d..f9d18d48 100755 --- a/libFoundation/config.guess +++ b/libFoundation/config.guess @@ -1,7 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. -# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-02-12' + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -14,87 +17,291 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \ + UNAME_MACHINE_ARCH=unknown + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - SR2?01:HI-UX/MPP:*:*) + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; - Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 @@ -102,9 +309,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo pyramid-pyramid-bsd fi exit 0 ;; - NILE:*:*:dcosx) + NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -129,33 +339,47 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -168,12 +392,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; - 2020:CLIX:*:*) + 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >dummy.c - int main (argc, argv) int argc; char **argv; { + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); @@ -188,12 +418,15 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - ${CC-cc} dummy.c -o dummy \ - && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -209,15 +442,18 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then echo m88k-dg-dgux${UNAME_RELEASE} - else + else echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} fi - else echo i586-dg-dgux${UNAME_RELEASE} - fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 @@ -238,12 +474,21 @@ EOF ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >dummy.c + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #include main() @@ -254,8 +499,8 @@ EOF exit(0); } EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -263,8 +508,9 @@ EOF echo rs6000-ibm-aix3.2 fi exit 0 ;; - *:AIX:*:4) - if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -272,7 +518,7 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=4.${UNAME_RELEASE} + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; @@ -282,7 +528,7 @@ EOF ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) @@ -297,18 +543,75 @@ EOF hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; - 9000/[3478]??:HP-UX:*:*) + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; - 9000/8?? ) HP_ARCH=hppa1.0 ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; 3050*:HI-UX:*:*) - sed 's/^ //' << EOF >dummy.c + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #include int main () @@ -333,8 +636,8 @@ EOF exit (0); } EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -343,13 +646,16 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -381,53 +687,70 @@ EOF echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; i*:CYGWIN*:*) - echo i386-pc-cygwin32 + echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) - echo i386-pc-mingw32 + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin32 + echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -435,78 +758,166 @@ EOF *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; - *:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. - ld_help_string=`ld --help 2>&1` - if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then - echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then - echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then - echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then - echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 - elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then - echo "powerpc-unknown-linux-gnu" ; exit 0 - elif test "${UNAME_MACHINE}" = "alpha" ; then - echo alpha-unknown-linux-gnu ; exit 0 - elif test "${UNAME_MACHINE}" = "sparc" ; then - echo sparc-unknown-linux-gnu ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >dummy.c <$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif EOF - ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us - # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout. - test ! -d /usr/lib/ldscripts/. \ - && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - # Determine whether the default compiler is a.out or elf - cat >dummy.c </dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif EOF - ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:3.2:*) + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; @@ -539,7 +963,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -550,24 +974,30 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; @@ -579,8 +1009,8 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -592,22 +1022,117 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + echo i386-${UNAME_MACHINE}-nto-qnx + else + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + fi + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 -cat >dummy.c <$dummy.c < # include @@ -645,7 +1170,10 @@ main () #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif @@ -690,11 +1218,24 @@ main () #endif #if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif #endif #if defined (alliant) && defined (i860) @@ -705,8 +1246,8 @@ main () } EOF -${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 -rm -f dummy.c dummy +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy # Apollos put the system type in the environment. @@ -738,6 +1279,48 @@ then esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/libFoundation/config.sub b/libFoundation/config.sub index ea9ed1bf..427d6c92 100755 --- a/libFoundation/config.sub +++ b/libFoundation/config.sub @@ -1,6 +1,10 @@ #! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-02-12' + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. @@ -17,14 +21,17 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. @@ -45,30 +52,73 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - linux-gnu*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -94,20 +144,28 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; - -sim | -cisco | -oki | -wec | -winbond ) # EGCS LOCAL + -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; - -scout) # EGCS LOCAL + -scout) ;; - -wrs) # EGCS LOCAL + -wrs) os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -156,49 +214,60 @@ case $os in -psos*) os=-psos ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 \ - | tron | a29k | 580 | i960 | h8300 \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | s390 \ - | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ - | mipstx39 | mipstx39el \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x) - basic_machine=$basic_machine-unknown - ;; - m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \ - | h8500 | w65) # EGCS LOCAL - ;; - thumb) - basic_machine=$basic_machine-unknown - ;; - mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300 - basic_machine=$basic_machine-unknown - ;; - mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100 - basic_machine=$basic_machine-unknown - ;; - mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000 + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dsp16xx \ + | fr30 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; - mips16) + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown + os=-none ;; - d10v) - basic_machine=$basic_machine-unknown + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[34567]86) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -207,44 +276,49 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ - | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* \ - | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ - | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \ - | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \ - | xps100-* | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mipstx39-* | mipstx39el-* \ - | f301-* | arm*-*) - ;; - m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL - ;; - thumb-*) # EGCS LOCAL angela/thumb - ;; - v850-*) # EGCS LOCAL - ;; - d30v-*) # EGCS LOCAL - ;; - mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300 - ;; - mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100 - ;; - mips16-*) # EGCS LOCAL krk/mips16 - ;; - tic30-*) # EGCS LOCAL ian/tic30 - ;; - c30-*) # EGCS LOCAL ian/tic30 - basic_machine=tic30-unknown + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cray2-* | cydra-* \ + | d10v-* | d30v-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | m32r-* \ + | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) # EGCS LOCAL + 386bsd) basic_machine=i386-unknown os=-bsd ;; @@ -254,11 +328,11 @@ case $basic_machine in 3b*) basic_machine=we32k-att ;; - a29khif) # EGCS LOCAL + a29khif) basic_machine=a29k-amd os=-udi ;; - adobe68k) # EGCS LOCAL + adobe68k) basic_machine=m68010-adobe os=-scout ;; @@ -277,21 +351,21 @@ case $basic_machine in os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; amigaos | amigados) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; - apollo68bsd) # EGCS LOCAL + apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; @@ -331,19 +405,30 @@ case $basic_machine in basic_machine=cray2-cray os=-unicos ;; - [ctj]90-cray) - basic_machine=c90-cray + [cjt]90) + basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -371,7 +456,7 @@ case $basic_machine in encore | umax | mmax) basic_machine=ns32k-encore ;; - es1800 | OSE68k | ose68k | ose | OSE) # EGCS LOCAL + es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; @@ -385,6 +470,10 @@ case $basic_machine in basic_machine=tron-gmicro os=-sysv ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -393,11 +482,11 @@ case $basic_machine in basic_machine=h8300-hitachi os=-hms ;; - h8300xray) # EGCS LOCAL + h8300xray) basic_machine=h8300-hitachi os=-xray ;; - h8500hms) # EGCS LOCAL + h8500hms) basic_machine=h8500-hitachi os=-hms ;; @@ -416,22 +505,6 @@ case $basic_machine in basic_machine=m68k-hp os=-hpux ;; - w89k-*) # EGCS LOCAL - basic_machine=hppa1.1-winbond - os=-proelf - ;; - op50n-*) # EGCS LOCAL - basic_machine=hppa1.1-oki - os=-proelf - ;; - op60c-*) # EGCS LOCAL - basic_machine=hppa1.1-oki - os=-proelf - ;; - hppro) # EGCS LOCAL - basic_machine=hppa1.1-hp - os=-proelf - ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; @@ -441,22 +514,21 @@ case $basic_machine in hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9] ) + hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9] ) + hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; - hp9k78[0-9] | hp78[0-9] ) + hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \ - hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 ) + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; - hp9k8[0-9][13679] | hp8[0-9][13679] ) + hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) @@ -465,47 +537,42 @@ case $basic_machine in hppa-next) os=-nextstep3 ;; - hppaosf) # EGCS LOCAL + hppaosf) basic_machine=hppa1.1-hp os=-osf ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; i370-ibm* | ibm*) basic_machine=i370-ibm - os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; - i386mach) # EGCS LOCAL + i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) # EGCS LOCAL + i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; - i386-go32 | go32) # EGCS LOCAL - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -531,9 +598,17 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; miniframe) basic_machine=m68000-convergent ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu @@ -548,24 +623,36 @@ case $basic_machine in mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; - monitor) # EGCS LOCAL + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) basic_machine=m68k-rom68k os=-coff ;; - msdos) # EGCS LOCAL - basic_machine=i386-unknown + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc os=-msdos ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) - basic_machine=i386-unknown # EGCS LOCAL + basic_machine=i386-unknown os=-netbsd ;; netwinder) - basic_machine=armv4l-corel + basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) @@ -580,7 +667,7 @@ case $basic_machine in basic_machine=mips-sony os=-newsos ;; - necv70) # EGCS LOCAL + necv70) basic_machine=v70-nec os=-sysv ;; @@ -609,18 +696,33 @@ case $basic_machine in basic_machine=i960-intel os=-nindy ;; - mon960) # EGCS LOCAL + mon960) basic_machine=i960-intel os=-mon960 ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; - OSE68000 | ose68000) # EGCS LOCAL + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; - os68k) # EGCS LOCAL + os68k) basic_machine=m68k-none os=-os68k ;; @@ -641,28 +743,28 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexen) + pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) - basic_machine=i786-pc + basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; - power) basic_machine=rs6000-ibm + power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; @@ -674,10 +776,24 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; - rom68k) # EGCS LOCAL + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) basic_machine=m68k-rom68k os=-coff ;; @@ -687,11 +803,13 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; - s390-ibm*|s390-*) + s390 | s390-*) basic_machine=s390-ibm - os=-linux ;; - sa29200) # EGCS LOCAL + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) basic_machine=a29k-amd os=-udi ;; @@ -702,7 +820,7 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) # EGCS LOCAL + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -713,10 +831,10 @@ case $basic_machine in spur) basic_machine=spur-unknown ;; - st2000) # EGCS LOCAL + st2000) basic_machine=m68k-tandem ;; - stratus) # EGCS LOCAL + stratus) basic_machine=i860-stratus os=-sysv4 ;; @@ -760,16 +878,32 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; symmetry) basic_machine=i386-sequent os=-dynix ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -781,7 +915,7 @@ case $basic_machine in basic_machine=a29k-nyu os=-sym1 ;; - v810 | necv810) # EGCS LOCAL + v810 | necv810) basic_machine=v810-nec os=-none ;; @@ -808,9 +942,17 @@ case $basic_machine in basic_machine=a29k-wrs os=-vxworks ;; - w65*) # EGCS LOCAL - basic_machine=w65-wdc - os=-none + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt ;; xmp) basic_machine=xmp-cray @@ -819,7 +961,7 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; - z8k-*-coff) # EGCS LOCAL + z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; @@ -830,13 +972,13 @@ case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. - w89k) # EGCS LOCAL + w89k) basic_machine=hppa1.1-winbond ;; - op50n) # EGCS LOCAL + op50n) basic_machine=hppa1.1-oki ;; - op60c) # EGCS LOCAL + op60c) basic_machine=hppa1.1-oki ;; mips) @@ -855,13 +997,23 @@ case $basic_machine in vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; - sparc | sparcv9) + sh3 | sh4 | sh3eb | sh4eb) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -873,16 +1025,19 @@ case $basic_machine in orion105) basic_machine=clipper-highlevel ;; - mac | mpw | mac-mpw) # EGCS LOCAL + mac | mpw | mac-mpw) basic_machine=m68k-apple ;; - pmac | pmac-mpw) # EGCS LOCAL + pmac | pmac-mpw) basic_machine=powerpc-apple ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -939,20 +1094,35 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* ) + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux*) # Remember, each alternative MUST END IN *, to match a version number. ;; - # EGCS LOCAL + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mon960* | -lnews* ) + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; - # END EGCS LOCAL -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -962,6 +1132,12 @@ case $os in -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; -osfrose*) os=-osfrose ;; @@ -977,7 +1153,10 @@ case $os in -acis*) os=-aos ;; - -386bsd) # EGCS LOCAL + -atheos*) + os=-atheos + ;; + -386bsd) os=-bsd ;; -ctix* | -uts*) @@ -986,6 +1165,9 @@ case $os in -ns2 ) os=-nextstep2 ;; + -nsk*) + os=-nsk + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -1011,15 +1193,18 @@ case $os in # This must come after -sysvr4. -sysv*) ;; - -ose*) # EGCS LOCAL + -ose*) os=-ose ;; - -es1800*) # EGCS LOCAL + -es1800*) os=-ose ;; -xenix) os=-xenix ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; -none) ;; *) @@ -1045,12 +1230,16 @@ case $basic_machine in *-acorn) os=-riscix1.2 ;; - arm*-corel) + arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; pdp11-*) os=-none ;; @@ -1069,15 +1258,18 @@ case $basic_machine in # default. # os=-sunos4 ;; - m68*-cisco) # EGCS LOCAL + m68*-cisco) os=-aout ;; - mips*-cisco) # EGCS LOCAL + mips*-cisco) + os=-elf + ;; + mips*-*) os=-elf ;; - mips*-*) # EGCS LOCAL - os=-elf - ;; + or32-*) + os=-coff + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -1090,13 +1282,13 @@ case $basic_machine in *-ibm) os=-aix ;; - *-wec) # EGCS LOCAL + *-wec) os=-proelf ;; - *-winbond) # EGCS LOCAL + *-winbond) os=-proelf ;; - *-oki) # EGCS LOCAL + *-oki) os=-proelf ;; *-hp) @@ -1159,18 +1351,21 @@ case $basic_machine in *-masscomp) os=-rtu ;; - f301-fujitsu) + f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; - *-rom68k) # EGCS LOCAL + *-rom68k) os=-coff ;; - *-*bug) # EGCS LOCAL + *-*bug) os=-coff ;; - *-apple) # EGCS LOCAL + *-apple) os=-macos ;; + *-atari*) + os=-mint + ;; *) os=-none ;; @@ -1216,7 +1411,7 @@ case $basic_machine in -genix*) vendor=ns ;; - -mvs*) + -mvs* | -opened*) vendor=ibm ;; -ptx*) @@ -1228,15 +1423,29 @@ case $basic_machine in -aux*) vendor=apple ;; - -hms*) # EGCS LOCAL + -hms*) vendor=hitachi ;; - -mpw* | -macos*) # EGCS LOCAL + -mpw* | -macos*) vendor=apple ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/libFoundation/config/i386/openbsd3.8.h b/libFoundation/config/i386/openbsd3.8.h new file mode 100644 index 00000000..b4feb631 --- /dev/null +++ b/libFoundation/config/i386/openbsd3.8.h @@ -0,0 +1,37 @@ +/* + openbsd3.8.h + + Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. + All rights reserved. + + Author: Ovidiu Predescu + + This file is part of libFoundation. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + We disclaim all warranties with regard to this software, including all + implied warranties of merchantability and fitness, in no event shall + we be liable for any special, indirect or consequential damages or any + damages whatsoever resulting from loss of use, data or profits, whether in + an action of contract, negligence or other tortious action, arising out of + or in connection with the use or performance of this software. +*/ + +#ifndef __openbsd3_8_h__ +#define __openbsd3_8_h__ + +#include "linux.h" + +#endif /* __openbsd3_8_h__ */ + +/* + Local Variables: + c-basic-offset: 4 + tab-width: 8 + End: +*/ diff --git a/libFoundation/config/i386/openbsd3.9.h b/libFoundation/config/i386/openbsd3.9.h new file mode 100644 index 00000000..745eda97 --- /dev/null +++ b/libFoundation/config/i386/openbsd3.9.h @@ -0,0 +1,37 @@ +/* + openbsd3.9.h + + Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. + All rights reserved. + + Author: Ovidiu Predescu + + This file is part of libFoundation. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + We disclaim all warranties with regard to this software, including all + implied warranties of merchantability and fitness, in no event shall + we be liable for any special, indirect or consequential damages or any + damages whatsoever resulting from loss of use, data or profits, whether in + an action of contract, negligence or other tortious action, arising out of + or in connection with the use or performance of this software. +*/ + +#ifndef __openbsd3_9_h__ +#define __openbsd3_9_h__ + +#include "linux.h" + +#endif /* __openbsd3_9_h__ */ + +/* + Local Variables: + c-basic-offset: 4 + tab-width: 8 + End: +*/ diff --git a/libFoundation/config/powerpc64/linux.h b/libFoundation/config/powerpc64/linux.h index de4e0a5d..c3ce2008 100644 --- a/libFoundation/config/powerpc64/linux.h +++ b/libFoundation/config/powerpc64/linux.h @@ -25,7 +25,7 @@ #ifndef __linux_h__ #define __linux_h__ -#include "i386.h" +#include "powerpc64.h" #undef FUNCTION_VALUE #undef FUNCTION_SET_VALUE diff --git a/libFoundation/config/x86_64/linux-gnu.h b/libFoundation/config/x86_64/linux-gnu.h new file mode 100644 index 00000000..ec5a2149 --- /dev/null +++ b/libFoundation/config/x86_64/linux-gnu.h @@ -0,0 +1,37 @@ +/* + linux_gnu.h + + Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. + All rights reserved. + + Author: Ovidiu Predescu + + This file is part of libFoundation. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + We disclaim all warranties with regard to this software, including all + implied warranties of merchantability and fitness, in no event shall + we be liable for any special, indirect or consequential damages or any + damages whatsoever resulting from loss of use, data or profits, whether in + an action of contract, negligence or other tortious action, arising out of + or in connection with the use or performance of this software. +*/ + +#ifndef __linux_gnu_h__ +#define __linux_gnu_h__ + +#include "linux.h" + +#endif /* __linux_gnu_h__ */ + +/* + Local Variables: + c-basic-offset: 4 + tab-width: 8 + End: +*/ diff --git a/libFoundation/config/x86_64/linux.h b/libFoundation/config/x86_64/linux.h new file mode 100644 index 00000000..56401343 --- /dev/null +++ b/libFoundation/config/x86_64/linux.h @@ -0,0 +1,147 @@ +/* + linux.h + + Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. + All rights reserved. + + Author: Ovidiu Predescu + + This file is part of libFoundation. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + We disclaim all warranties with regard to this software, including all + implied warranties of merchantability and fitness, in no event shall + we be liable for any special, indirect or consequential damages or any + damages whatsoever resulting from loss of use, data or profits, whether in + an action of contract, negligence or other tortious action, arising out of + or in connection with the use or performance of this software. +*/ + +#ifndef __linux_h__ +#define __linux_h__ + +#include "x86_64.h" + +#undef FUNCTION_VALUE +#undef FUNCTION_SET_VALUE +#undef GET_STRUCT_VALUE_ADDRESS +#undef SET_STRUCT_VALUE_ADDRESS + +/* Define how to find the value returned by a function. TYPE is a Objective-C + encoding string describing the type of the returned value. ARGS is the + arguments frame passed to __builtin_apply. RESULT_FRAME is the address of + the block returned by __builtin_apply. RETURN_VALUE is an address where + this macro should put the returned value. */ + +#if 0 && defined(BROKEN_BUILTIN_APPLY) + +#define FUNCTION_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) { \ + float aFloat; \ + asm("fsts %0" : "=f2" (aFloat) :); \ + *(float*)(RETURN_VALUE) = aFloat; \ + } \ + else if(*(TYPE) == _C_DBL) { \ + double aDouble; \ + asm("fstl %0" : "=f2" (aDouble)); \ + *(double*)(RETURN_VALUE) = aDouble; \ + } \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy((RETURN_VALUE), *(void**)(RESULT_FRAME), type_size); \ + else memcpy((RETURN_VALUE), (RESULT_FRAME), type_size); }) + +#else /* !BROKEN_BUILTIN_APPLY */ + +#define FUNCTION_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) { \ + *(float*)(RETURN_VALUE) = \ + (float)*(long double*)(((char*)(RESULT_FRAME)) + 8); \ + } \ + else if(*(TYPE) == _C_DBL) { \ + *(double*)(RETURN_VALUE) = \ + (double)*(long double*)(((char*)(RESULT_FRAME)) + 8); \ + } \ + else if(*(TYPE) != _C_STRUCT_B && *(TYPE) != _C_UNION_B \ + && *(TYPE) != _C_ARY_B) \ + memcpy((RETURN_VALUE), (RESULT_FRAME), type_size); }) + +#endif /* !BROKEN_BUILTIN_APPLY */ + +/* Set the value in RETURN_VALUE to be the value returned by a function. + Assume that the fucntion was previously called and RESULT_FRAME is the + address of the block returned by __builtin_apply. TYPE is the actual + type of this value. ARGS is the address of block that was passed + to __builtin_apply. */ + +#if 0 && defined(BROKEN_BUILTIN_APPLY) + +#define FUNCTION_SET_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) { \ + float aFloat = *(float*)(RETURN_VALUE); \ + asm("fld %0" : : "f" (aFloat)); \ + } \ + else if(*(TYPE) == _C_DBL) { \ + double aDouble = *(double*)(RETURN_VALUE); \ + asm("fldl %0" : : "f" (aDouble)); \ + } \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy(*(void**)(ARGS), (RETURN_VALUE), type_size); \ + else memcpy((RESULT_FRAME), (RETURN_VALUE), type_size); }) + +#else /* !BROKEN_BUILTIN_APPLY */ + +#define FUNCTION_SET_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) \ + *(long double*)(((char*)(RESULT_FRAME)) + 8) = \ + (long double)*(float*)(RETURN_VALUE); \ + else if(*(TYPE) == _C_DBL) \ + *(long double*)(((char*)(RESULT_FRAME)) + 8) = \ + (long double)*(double*)(RETURN_VALUE); \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy(*(void**)(ARGS), (RETURN_VALUE), type_size); \ + else memcpy((RESULT_FRAME), (RETURN_VALUE), type_size); }) + +#endif /* !BROKEN_BUILTIN_APPLY */ + +/* If the RETTYPE is a structure and the address of the structure value is + passed to the called function, then obtain from ARGS its address. In general + this address is the second pointer into the arguments frame. However on + linux this address is passed as the first argument to the called function. + This macro should produce 0 if the RETTYPE doesn't match the conditions + above. */ + +#define GET_STRUCT_VALUE_ADDRESS(ARGS, RETTYPE) \ + ((*(RETTYPE) == _C_STRUCT_B || *(RETTYPE) == _C_UNION_B \ + || *(RETTYPE) == _C_ARY_B) ? \ + **(void***)(ARGS) \ + : 0) + +/* Prepare ARGS for calling the function. If the function returns a struct by + value, it's the caller responsability to pass to the called function the + address of where to store the structure value. */ + +#define SET_STRUCT_VALUE_ADDRESS(ARGS, ADDR, RETTYPE) \ + if(*(RETTYPE) == _C_STRUCT_B || *(RETTYPE) == _C_UNION_B \ + || *(RETTYPE) == _C_ARY_B) \ + **(void***)(ARGS) = (ADDR); + +#endif /* __linux_h__ */ + +/* + Local Variables: + c-basic-offset: 4 + tab-width: 8 + End: +*/ diff --git a/libFoundation/config/x86_64/x86_64.h b/libFoundation/config/x86_64/x86_64.h new file mode 100644 index 00000000..d7324b53 --- /dev/null +++ b/libFoundation/config/x86_64/x86_64.h @@ -0,0 +1,218 @@ +/* + x86_64.h + + Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea. + All rights reserved. + + Author: Ovidiu Predescu + + This file is part of libFoundation. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. + + We disclaim all warranties with regard to this software, including all + implied warranties of merchantability and fitness, in no event shall + we be liable for any special, indirect or consequential damages or any + damages whatsoever resulting from loss of use, data or profits, whether in + an action of contract, negligence or other tortious action, arising out of + or in connection with the use or performance of this software. +*/ + +#ifndef __x86_64_h__ +#define __x86_64_h__ + +// TODO: fix for x86_64!!! +// this file is just a copy of i386.h + +#ifndef OBJC_FORWARDING_STACK_OFFSET +#define OBJC_FORWARDING_STACK_OFFSET 0 +#endif + +#ifndef OBJC_FORWARDING_MIN_OFFSET +#define OBJC_FORWARDING_MIN_OFFSET 0 +#endif + +/* Define the size of the block returned by __builtin_apply_args. This value is + computed by the function in expr.c. The block contains in order: a pointer + to the stack arguments frame, the structure value address unless this is + passed as an "invisible" first argument and all registers that may be used + in calling a function. */ + +// TODO: fix for x86_64!!! +#define APPLY_ARGS_SIZE 8 + +/* Define the size of the result block returned by the __builtin_apply. This + block contains all registers that could be used to return the function + value. This value is computed by apply_result_size function in expr.c. There + are also machines where this value is predefined in the machine description + file, so that machine specific information can be stored. */ + +// TODO: fix for x86_64!!! +#define APPLY_RESULT_SIZE 116 + +/* Define how to find the value returned by a function. TYPE is a Objective-C + encoding string describing the type of the returned value. ARGS is the + arguments frame passed to __builtin_apply. RESULT_FRAME is the address of + the block returned by __builtin_apply. RETURN_VALUE is an address where + this macro should put the returned value. */ + +#ifdef BROKEN_BUILTIN_APPLY + +#define FUNCTION_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) { \ + float aFloat; \ + asm("fsts %0" : "=f2" (aFloat) :); \ + *(float*)(RETURN_VALUE) = aFloat; \ + } \ + else if(*(TYPE) == _C_DBL) { \ + double aDouble; \ + asm("fstl %0" : "=f2" (aDouble)); \ + *(double*)(RETURN_VALUE) = aDouble; \ + } \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy((RETURN_VALUE), \ + *(void**)(((char*)(ARGS)) + sizeof(void*)), type_size); \ + else memcpy((RETURN_VALUE), (RESULT_FRAME), type_size); }) + +#else /* !BROKEN_BUILTIN_APPLY */ + +#define FUNCTION_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) { \ + *(float*)(RETURN_VALUE) = \ + (float)*(long double*)(((char*)(RESULT_FRAME)) + 8); \ + } \ + else if(*(TYPE) == _C_DBL) { \ + *(double*)(RETURN_VALUE) = \ + (double)*(long double*)(((char*)(RESULT_FRAME)) + 8); \ + } \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy((RETURN_VALUE), \ + *(void**)(((char*)(ARGS)) + sizeof(void*)), type_size); \ + else memcpy((RETURN_VALUE), (RESULT_FRAME), type_size); }) + +#endif /* !BROKEN_BUILTIN_APPLY */ + +/* Set the value in RETURN_VALUE to be the value returned by a function. + Assume that the fucntion was previously called and RESULT_FRAME is the + address of the block returned by __builtin_apply. TYPE is the actual + type of this value. ARGS is the address of block that was passed + to __builtin_apply. */ + +#ifdef BROKEN_BUILTIN_APPLY + +#define FUNCTION_SET_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) { \ + float aFloat = *(float*)(RETURN_VALUE); \ + asm("fld %0" : : "f" (aFloat)); \ + } \ + else if(*(TYPE) == _C_DBL) { \ + double aDouble = *(double*)(RETURN_VALUE); \ + asm("fldl %0" : : "f" (aDouble)); \ + } \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy(*(void**)(((char*)(ARGS)) + sizeof(void*)), \ + (RETURN_VALUE), type_size); \ + else memcpy((RESULT_FRAME), (RETURN_VALUE), type_size); }) + +#else /* !BROKEN_BUILTIN_APPLY */ + +#define FUNCTION_SET_VALUE(TYPE, ARGS, RESULT_FRAME, RETURN_VALUE) \ + ({ int type_size = objc_sizeof_type(TYPE); \ + if(*(TYPE) == _C_FLT) \ + *(long double*)(((char*)(RESULT_FRAME)) + 8) = \ + (long double)*(float*)(RETURN_VALUE); \ + else if(*(TYPE) == _C_DBL) \ + *(long double*)(((char*)(RESULT_FRAME)) + 8) = \ + (long double)*(double*)(RETURN_VALUE); \ + else if(*(TYPE) == _C_STRUCT_B || *(TYPE) == _C_UNION_B \ + || *(TYPE) == _C_ARY_B) \ + memcpy(*(void**)(((char*)(ARGS)) + sizeof(void*)), \ + (RETURN_VALUE), type_size); \ + else memcpy((RESULT_FRAME), (RETURN_VALUE), type_size); }) + +#endif /* !BROKEN_BUILTIN_APPLY */ + +/* If the RETTYPE is a structure and the address of the structure value is + passed to the called function, then obtain from ARGS its address. In general + this address is the second pointer into the arguments frame. This macro + should produce 0 if the RETTYPE doesn't match the conditions above. */ + +#define GET_STRUCT_VALUE_ADDRESS(ARGS, RETTYPE) \ + ((*(RETTYPE) == _C_STRUCT_B || *(RETTYPE) == _C_UNION_B \ + || *(RETTYPE) == _C_ARY_B) ? \ + *(void**)(((char*)(ARGS)) + sizeof(void*)) \ + : 0) + +/* Prepare ARGS for calling the function. If the function returns a struct by + value, it's the caller responsability to pass to the called function the + address of where to store the structure value. */ + +#define SET_STRUCT_VALUE_ADDRESS(ARGS, ADDR, RETTYPE) \ + *(void**)(((char*)(ARGS)) + sizeof(void*)) = (ADDR) + + +/* The following macros are used to determine the encoding of a selector given + the types of arguments. This macros follows the similar ones defined in the + target machine description from the compiler sources. */ + +/* Define a data type for recording info about the arguments list of a method. + A variable of this type is further used by FUNCTION_ARG_ENCODING to + determine the encoding of an argument. This type should record all info + about arguments processed so far. */ + +#define CUMULATIVE_ARGS int + +/* Initialize a variable of type CUMULATIVE_ARGS. This macro is called before + processing the first argument of a method. */ + +#define INIT_CUMULATIVE_ARGS(CUM) ((CUM) = 0) + +/* This macro determines the encoding of the next argument of a method. It is + called repetitively, starting with the first argument and continuing to the + last one. CUM is a variable of type CUMULATIVE_ARGS. TYPE is a NSString + which represents the type of the argument processed. This macro must + produce a NSString whose value represents the encoding and position of the + current argument. STACKSIZE is a variable that counts the number of bytes + occupied by the arguments on the stack. */ + +#ifndef ROUND +#define ROUND(V, A) \ + ({ typeof(V) __v=(V); typeof(A) __a=(A); \ + __a*((__v+__a-1)/__a); }) +#endif + +#define FUNCTION_ARG_ENCODING(CUM, TYPE, STACK_ARGSIZE) \ + ({ id encoding; \ + const char* type = [(TYPE) cString]; \ + int align = objc_alignof_type(type); \ + int type_size = objc_sizeof_type(type); \ +\ + (CUM) = ROUND((CUM), align); \ + encoding = [NSString stringWithFormat:@"%@%d", \ + (TYPE), \ + (CUM) + OBJC_FORWARDING_STACK_OFFSET]; \ + if((*type == _C_STRUCT_B || *type == _C_UNION_B || *type == _C_ARY_B) \ + && type_size > 2) \ + (STACK_ARGSIZE) = (CUM) + ROUND(type_size, align); \ + else (STACK_ARGSIZE) = (CUM) + type_size; \ + (CUM) += ROUND(type_size, sizeof(void*)); \ + encoding; }) + +#endif /* __x86_64_h__ */ + +/* + Local Variables: + c-basic-offset: 4 + tab-width: 8 + End: +*/ diff --git a/libFoundation/configure b/libFoundation/configure index 06d1d41a..4a1c1fb5 100755 --- a/libFoundation/configure +++ b/libFoundation/configure @@ -552,7 +552,7 @@ fi # ******************** GNUstep env ************************************ -if test "x$GNUSTEP_SYSTEM_ROOT" = "x"; then +if test "x${GNUSTEP_MAKEFILES}" = "x"; then { echo "configure: error: Your GNUstep.sh is not sourced" 1>&2; exit 1; } fi @@ -560,8 +560,8 @@ fi # todo: read from Version file? MAJOR_VERSION=1 -MINOR_VERSION=0 -SUBMINOR_VERSION=73 +MINOR_VERSION=1 +SUBMINOR_VERSION=3 @@ -1646,7 +1646,7 @@ fi RUNTIME=GNU -transformed_target_cpu=`${GNUSTEP_SYSTEM_ROOT}/Makefiles/clean_cpu.sh ${TARGET_CPU}` +transformed_target_cpu=`${GNUSTEP_MAKEFILES}/clean_cpu.sh ${TARGET_CPU}` ac_cv_file_output_prefix=Foundation/$transformed_target_cpu/${TARGET_OS}/$RUNTIME @@ -1676,6 +1676,7 @@ else #line 1677 "configure" #include "confdefs.h" +#include f(void (*nested)()) { (*nested)(); @@ -1695,7 +1696,7 @@ main() } EOF -if { (eval echo configure:1699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_nested_functions=yes else @@ -1727,7 +1728,7 @@ EOF fi echo $ac_n "checking if the Objective-C compiler crashes with nested functions""... $ac_c" 1>&6 -echo "configure:1731: checking if the Objective-C compiler crashes with nested functions" >&5 +echo "configure:1732: checking if the Objective-C compiler crashes with nested functions" >&5 if eval "test \"`echo '$''{'ac_cv_broken_compiler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1749,11 +1750,12 @@ if test "$cross_compiling" = yes; then ac_cv_broken_compiler=no else cat > conftest.$ac_ext < #include +#include void f() { @@ -1786,7 +1788,7 @@ main() } EOF -if { (eval echo configure:1790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_compiler=no else @@ -1821,7 +1823,7 @@ echo "$ac_t""${ac_cv_broken_compiler}" 1>&6 if test $target_cpu = i386; then echo $ac_n "checking whether __builtin_apply and __builtin_return are broken""... $ac_c" 1>&6 -echo "configure:1825: checking whether __builtin_apply and __builtin_return are broken" >&5 +echo "configure:1827: checking whether __builtin_apply and __builtin_return are broken" >&5 if eval "test \"`echo '$''{'ac_cv_broken_builtin_apply'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1843,7 +1845,7 @@ if test "$cross_compiling" = yes; then ac_cv_broken_builtin_apply=no else cat > conftest.$ac_ext < @@ -1895,7 +1897,7 @@ int main() } EOF -if { (eval echo configure:1899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_broken_builtin_apply=no else @@ -1937,17 +1939,17 @@ for ac_hdr in ${GC_INCLUDE_DIR}gc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1941: checking for $ac_hdr" >&5 +echo "configure:1943: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1976,7 +1978,7 @@ done if test "x$ac_cv_link_gc" = xyes; then echo $ac_n "checking for GC_malloc in -l${GC_LIB}""... $ac_c" 1>&6 -echo "configure:1980: checking for GC_malloc in -l${GC_LIB}" >&5 +echo "configure:1982: checking for GC_malloc in -l${GC_LIB}" >&5 ac_lib_var=`echo ${GC_LIB}'_'GC_malloc | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1984,7 +1986,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${GC_LIB} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2034,14 +2036,14 @@ if test x"$cross_compiling" = xyes; then echo "WARNING: cannot check for byte-order during cross compilation." else echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2038: checking whether byte ordering is bigendian" >&5 +echo "configure:2040: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2052,11 +2054,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2067,7 +2069,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2087,7 +2089,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2126,13 +2128,13 @@ fi fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2130: checking size of short" >&5 +echo "configure:2132: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2142,7 +2144,7 @@ int main() { switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_short=$ac_size else @@ -2166,13 +2168,13 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2170: checking size of int" >&5 +echo "configure:2172: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2182,7 +2184,7 @@ int main() { switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_int=$ac_size else @@ -2206,13 +2208,13 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2210: checking size of long" >&5 +echo "configure:2212: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2222,7 +2224,7 @@ int main() { switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long=$ac_size else @@ -2246,13 +2248,13 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:2250: checking size of long long" >&5 +echo "configure:2252: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2262,7 +2264,7 @@ int main() { switch (0) case 0: case (sizeof (long long) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_long=$ac_size else @@ -2286,13 +2288,13 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:2290: checking size of float" >&5 +echo "configure:2292: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2302,7 +2304,7 @@ int main() { switch (0) case 0: case (sizeof (float) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_float=$ac_size else @@ -2326,13 +2328,13 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:2330: checking size of double" >&5 +echo "configure:2332: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2342,7 +2344,7 @@ int main() { switch (0) case 0: case (sizeof (double) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_double=$ac_size else @@ -2366,13 +2368,13 @@ EOF echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:2370: checking size of long double" >&5 +echo "configure:2372: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -2382,7 +2384,7 @@ int main() { switch (0) case 0: case (sizeof (long double) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:2386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_double=$ac_size else @@ -2411,12 +2413,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:2415: checking for $ac_hdr that defines DIR" >&5 +echo "configure:2417: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -2424,7 +2426,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:2428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -2449,7 +2451,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:2453: checking for opendir in -ldir" >&5 +echo "configure:2455: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2457,7 +2459,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2490,7 +2492,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:2494: checking for opendir in -lx" >&5 +echo "configure:2496: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2498,7 +2500,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2535,17 +2537,17 @@ for ac_hdr in dir.h libc.h sys/time.h stdlib.h memory.h string.h strings.h sys do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2539: checking for $ac_hdr" >&5 +echo "configure:2541: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2572,12 +2574,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2576: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:2578: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2593,7 +2595,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2617,12 +2619,12 @@ fi for ac_func in memcpy ualarm getcwd getuid getpwnam getpwuid kill raise getpagesize statvfs chown symlink readlink opendir fsync sysconf GetSystemInfo gettimeofday GetLocalTime sigsetmask sigset sigaction sighold gethostbyname_r gethostbyaddr_r gethostent_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2621: checking for $ac_func" >&5 +echo "configure:2623: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2673,17 +2675,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2677: checking for $ac_hdr" >&5 +echo "configure:2679: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2712,12 +2714,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2716: checking for $ac_func" >&5 +echo "configure:2718: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2765,7 +2767,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2769: checking for working mmap" >&5 +echo "configure:2771: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2773,7 +2775,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2936,12 +2938,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2940: checking for ANSI C header files" >&5 +echo "configure:2942: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2949,7 +2951,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2966,7 +2968,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2984,7 +2986,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3005,7 +3007,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3016,7 +3018,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3040,12 +3042,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3044: checking for pid_t" >&5 +echo "configure:3046: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3074,17 +3076,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:3078: checking for vfork.h" >&5 +echo "configure:3080: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3109,18 +3111,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3113: checking for working vfork" >&5 +echo "configure:3115: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:3119: checking for vfork" >&5 +echo "configure:3121: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -3165,7 +3167,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -3260,7 +3262,7 @@ main() { } } EOF -if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -3283,12 +3285,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3287: checking return type of signal handlers" >&5 +echo "configure:3289: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3305,7 +3307,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3325,12 +3327,12 @@ EOF echo $ac_n "checking for sqrt""... $ac_c" 1>&6 -echo "configure:3329: checking for sqrt" >&5 +echo "configure:3331: checking for sqrt" >&5 if eval "test \"`echo '$''{'ac_cv_func_sqrt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sqrt=yes" else @@ -3373,7 +3375,7 @@ else LIBS="$LIBS -lm -lc" ac_cv_func_sqrt=no cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_sqrt="-lm -lc" else @@ -3402,7 +3404,7 @@ if test "$cross_compiling" = yes; then echo "WARNING: cannot check for restartable system calls during cross compilation." else echo $ac_n "checking for restartable system calls""... $ac_c" 1>&6 -echo "configure:3406: checking for restartable system calls" >&5 +echo "configure:3408: checking for restartable system calls" >&5 if eval "test \"`echo '$''{'ac_cv_sys_restartable_syscalls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3410,7 +3412,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sys_restartable_syscalls=yes else diff --git a/libFoundation/configure.in b/libFoundation/configure.in index 7a4a4fbb..a81253f9 100644 --- a/libFoundation/configure.in +++ b/libFoundation/configure.in @@ -4,7 +4,7 @@ AC_INIT(${srcdir}/Foundation/NSObject.h.in) # ******************** GNUstep env ************************************ -if test "x$GNUSTEP_SYSTEM_ROOT" = "x"; then +if test "x${GNUSTEP_MAKEFILES}" = "x"; then AC_MSG_ERROR(Your GNUstep.sh is not sourced, please load GNUstep.sh prior running configure!) fi @@ -12,8 +12,8 @@ fi # todo: read from Version file? MAJOR_VERSION=1 -MINOR_VERSION=0 -SUBMINOR_VERSION=73 +MINOR_VERSION=1 +SUBMINOR_VERSION=3 AC_SUBST(MAJOR_VERSION) AC_SUBST(MINOR_VERSION) @@ -213,7 +213,7 @@ AC_CHECK_LIB(nsl, chown) AC_CHECK_LIB(socket, accept) RUNTIME=GNU -transformed_target_cpu=`${GNUSTEP_SYSTEM_ROOT}/Makefiles/clean_cpu.sh ${TARGET_CPU}` +transformed_target_cpu=`${GNUSTEP_MAKEFILES}/clean_cpu.sh ${TARGET_CPU}` ac_cv_file_output_prefix=Foundation/$transformed_target_cpu/${TARGET_OS}/$RUNTIME diff --git a/libFoundation/debian/changelog b/libFoundation/debian/changelog index 04edda43..774037fd 100644 --- a/libFoundation/debian/changelog +++ b/libFoundation/debian/changelog @@ -1,3 +1,23 @@ +libfoundation1.1 (1.1.2-1) unstable; urgency=low + + * New upstream release + * doesn't require libobjc-lf2 anymore + + -- Frank Reppin Thu, 13 Jul 2006 13:03:00 +0200 + +libfoundation1.0 (1.0.76-1) unstable; urgency=low + + * New upstream release + * Declare an existing alternative dependency to virtual package libobjc-lf-dev + + -- Sebastian Ley Thu, 11 Aug 2005 11:48:39 +0200 + +libfoundation1.0 (1.0.72-1) unstable; urgency=low + + * New upstream release. + + -- Sebastian Ley Sun, 7 Aug 2005 23:19:43 +0200 + libfoundation1.0 (1.0r24-1) experimental; urgency=low * Initial Release. diff --git a/libFoundation/debian/control b/libFoundation/debian/control index 2964f19d..7d4fd4e9 100644 --- a/libFoundation/debian/control +++ b/libFoundation/debian/control @@ -1,15 +1,15 @@ -Source: libfoundation1.0 +Source: libfoundation1.1 Priority: extra Maintainer: Sebastian Ley -Build-Depends: debhelper (>= 4.0.0), dpatch, gnustep-make-ogo, gobjc | objc-compiler, libobjc-lf-dev +Build-Depends: debhelper (>= 4.0.0), dpatch, gnustep-make-ogo, gobjc | objc-compiler, libobjc1 Standards-Version: 3.6.1 -Package: libfoundation1.0-dev +Package: libfoundation1.1-dev Section: libdevel Architecture: any Provides: libfoundation-dev -Conflicts: libfoundation-dev -Depends: libfoundation1.0 (= ${Source-Version}) +Conflicts: libfoundation-dev, libfoundation1.0-dev +Depends: libfoundation1.1 (= ${Source-Version}) Description: Development files for libfoundation LibFoundation is a library that provides an almost complete implementation of the OpenStep specification plus many other extensions @@ -17,10 +17,11 @@ Description: Development files for libfoundation . This package contains the development files of libFoundation. -Package: libfoundation1.0 +Package: libfoundation1.1 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libfoundation-data +Conflicts: libfoundation-ogo1.0, libfoundation1.0 Description: Implementation of the OpenStep specification LibFoundation is a library that provides an almost complete implementation of the OpenStep specification plus many other extensions diff --git a/libFoundation/debian/libfoundation1.1-dev.install b/libFoundation/debian/libfoundation1.1-dev.install new file mode 100644 index 00000000..bc830ce9 --- /dev/null +++ b/libFoundation/debian/libfoundation1.1-dev.install @@ -0,0 +1,3 @@ +usr/lib/*.so +usr/include +usr/lib/opengroupware.org/System/Library/Makefiles diff --git a/libFoundation/debian/libfoundation1.1.install b/libFoundation/debian/libfoundation1.1.install new file mode 100644 index 00000000..093956b1 --- /dev/null +++ b/libFoundation/debian/libfoundation1.1.install @@ -0,0 +1 @@ +usr/lib/*.so.* diff --git a/libFoundation/debian/rules b/libFoundation/debian/rules index 4283b0ad..e78cdcd2 100755 --- a/libFoundation/debian/rules +++ b/libFoundation/debian/rules @@ -106,7 +106,7 @@ binary-arch: build install # dh_python dh_makeshlibs -V dh_installdeb - dh_shlibdeps -L libfoundation1.0 -l debian/libfoundation1.0/usr/lib + dh_shlibdeps -L libfoundation1.1 -l debian/libfoundation1.1/usr/lib dh_gencontrol dh_md5sums dh_builddeb diff --git a/libFoundation/examples/Defaults.m b/libFoundation/examples/Defaults.m index 8a7b02c8..a95e43c9 100644 --- a/libFoundation/examples/Defaults.m +++ b/libFoundation/examples/Defaults.m @@ -25,7 +25,7 @@ #include -volatile void usage (void) +static void usage (void) { puts ("Tool to manipulate the defaults database of a generic implementation of"); puts ("OpenStep Foundation.\n"); @@ -59,40 +59,47 @@ volatile void usage (void) exit (0); } -void read_command (NSArray* arguments) +void read_command (NSArray *arguments) { - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - id result = [NSMutableDictionary dictionary]; - int argumentsCount = [arguments count]; + NSUserDefaults *defaults; + NSMutableDictionary *result; + unsigned argumentsCount; + + defaults = [NSUserDefaults standardUserDefaults]; + result = [NSMutableDictionary dictionaryWithCapacity:4]; + argumentsCount = [arguments count]; if (argumentsCount == 2) { /* Defaults read */ /* Show the defaults for all the persistent domains */ - NSArray* persistentDomainNames = [defaults persistentDomainNames]; - int i, count = [persistentDomainNames count]; - NSString* key; + NSArray *persistentDomainNames; + unsigned i, count; + NSString *key; - for (i = 0; i < count; i++) { + persistentDomainNames = [defaults persistentDomainNames]; + + for (i = 0, count = [persistentDomainNames count]; i < count; i++) { key = [persistentDomainNames objectAtIndex:i]; [result setObject:[defaults persistentDomainForName:key] forKey:key]; } } - else if (argumentsCount == 3 - || argumentsCount == 4) { /* Defaults read "domain name" [key] */ + else if (argumentsCount == 3 || argumentsCount == 4) { + /* Defaults read "domain name" [key] */ /* Show the defaults for a given domain */ - NSString* domainName = [arguments objectAtIndex:2]; + NSString *domainName = [arguments objectAtIndex:2]; - result = [defaults persistentDomainForName:domainName]; - if (!result) { + result = (NSMutableDictionary *) + [defaults persistentDomainForName:domainName]; + if (result == nil) { NSLog(@"Domain '%@' does not exist!", domainName); exit (1); } if (argumentsCount == 4) { - NSString* key = [arguments objectAtIndex:3]; - id value = [result objectForKey:key]; - - if (!value) { + NSString *key = [arguments objectAtIndex:3]; + id value = [result objectForKey:key]; + + if (value == nil) { NSLog(@"There is no key '%@' under the '%@' domain!", key, domainName); exit (1); @@ -103,10 +110,12 @@ void read_command (NSArray* arguments) } else if (argumentsCount == 4) { /* Defaults read "domain name" key */ /* Show the defaults for a given key in a domain */ - NSString* domainName = [arguments objectAtIndex:2]; + NSString *domainName; - result = [defaults persistentDomainForName:domainName]; - if (!result) { + domainName = [arguments objectAtIndex:2]; + result = (NSMutableDictionary *) + [defaults persistentDomainForName:domainName]; + if (result == nil) { NSLog (@"Domain '%@' does not exist!", domainName); exit (1); } diff --git a/libFoundation/examples/GNUmakefile b/libFoundation/examples/GNUmakefile index 2702aa37..7eeaf15e 100644 --- a/libFoundation/examples/GNUmakefile +++ b/libFoundation/examples/GNUmakefile @@ -24,9 +24,9 @@ -include ../gsfix.make -ifeq ($(GNUSTEP_SYSTEM_ROOT),) +ifeq ($(GNUSTEP_MAKEFILES),) -$(warning ERROR: Your $(GNUSTEP_SYSTEM_ROOT) environment variable is empty !) +$(warning ERROR: Your $(GNUSTEP_MAKEFILES) environment variable is empty !) $(error Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh") else @@ -37,6 +37,7 @@ OBJC_RUNTIME=GNU GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) include $(GNUSTEP_MAKEFILES)/common.make +-include ../Foundation/libFoundation.make ifeq ($(gc), yes) ifeq ($(LIBFOUNDATION_WITH_GC), yes) @@ -54,8 +55,14 @@ endif ADDITIONAL_LIB_DIRS = \ -L../Foundation/$(GNUSTEP_OBJ_DIR) \ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) SYSTEM_LIB_DIR += \ - -L/usr/local/lib -L/usr/lib + -L$(FHS_INSTALL_ROOT)/lib64 \ + -L/usr/local/lib64 \ + -L/usr/lib64 +else +SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +endif ADDITIONAL_INCLUDE_DIRS = \ -I.. \ diff --git a/libFoundation/libfoundation.spec b/libFoundation/libfoundation.spec index 7f224ad6..ad2ce8f2 100755 --- a/libFoundation/libfoundation.spec +++ b/libFoundation/libfoundation.spec @@ -10,7 +10,7 @@ Group: Development/Libraries AutoReqProv: off Source: %{libf_source} Prefix: %{libf_prefix} -Requires: libobjc-lf2 +#Requires: libobjc-lf2 Conflicts: libfoundation BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root