From 3a2f4b1a0518f99ae3ba185a4dbd1695f3605be6 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 6 Sep 2006 15:12:03 +0000 Subject: [PATCH 001/266] Thread safetly fix suggested by Wim git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23402 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSConnection.m | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index fe47d103e..50d5912d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-06 Richard Frith-Macdonald + + * Source/NSConnection.m: ([release]) protect with connection table + lock to prevent an other thread grabbing the connection while we + are deallocating it. Bug reported by Wim Oudshoorn. + 2006-08-28 Adam Fedor * Version 1.13.0 diff --git a/Source/NSConnection.m b/Source/NSConnection.m index 12161781a..d2ee860cb 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -1282,15 +1282,22 @@ static NSLock *cached_proxies_gate = nil; /* * If this would cause the connection to be deallocated then we * must perform all necessary work (done in [-gcFinalize]). + * * We bracket the code with a retain and release so that any * retain/release pairs in the code won't cause recursion. + * + * We lock the connection table while checking, to prevent + * another thread from grabbing this connection while we are + * finalizing/deallocating it. */ + M_LOCK(connection_table_gate); if ([self retainCount] == 1) { [super retain]; [self gcFinalize]; [super release]; } + M_UNLOCK(connection_table_gate); [super release]; } From ed68973dbfaa35624fa5542db2b81c4f77346286 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 6 Sep 2006 21:06:38 +0000 Subject: [PATCH 002/266] Allow recursive locking of connection table. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23406 72102866-910b-0410-8b05-ffd578937521 --- Source/NSConnection.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NSConnection.m b/Source/NSConnection.m index d2ee860cb..e23abd968 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -540,7 +540,7 @@ static NSLock *cached_proxies_gate = nil; if (connection_table_gate == nil) { - connection_table_gate = [GSLazyLock new]; + connection_table_gate = [GSLazyRecursiveLock new]; } if (cached_proxies_gate == nil) { From 056a8705328363c89800db806fa8334bc6450de9 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 7 Sep 2006 06:32:13 +0000 Subject: [PATCH 003/266] Minor backward compatibility tweak git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23407 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Headers/Foundation/NSObject.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50d5912d3..2097d0e12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-10 Richard Frith-Macdonald + + * Headers/Foundation/NSObject.h: Fix incorrect backward compatibility + setting for openstep version. + 2006-09-06 Richard Frith-Macdonald * Source/NSConnection.m: ([release]) protect with connection table diff --git a/Headers/Foundation/NSObject.h b/Headers/Foundation/NSObject.h index 2954db6a8..9967ccc29 100644 --- a/Headers/Foundation/NSObject.h +++ b/Headers/Foundation/NSObject.h @@ -32,10 +32,10 @@ * Check consistency of definitions for system compatibility. */ #if defined(STRICT_OPENSTEP) -#define OS_API_VERSION 10000 +#define GS_OPENSTEP_V 010000 #define NO_GNUSTEP 1 #elif defined(STRICT_MACOS_X) -#define OS_API_VERSION 100000 +#define GS_OPENSTEP_V 100000 #define NO_GNUSTEP 1 #else #undef NO_GNUSTEP From a00f8e94c7dcab987e6cfebadb669262dd407dc3 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 7 Sep 2006 11:47:45 +0000 Subject: [PATCH 004/266] Thread safety fixup git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23408 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 +++++- Source/NSConnection.m | 31 +++++++++++++-------------- Source/NSObject.m | 49 +++++++++++++++++++++---------------------- 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2097d0e12..d6b90d2b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,11 @@ -2006-09-10 Richard Frith-Macdonald +2006-09-07 Richard Frith-Macdonald * Headers/Foundation/NSObject.h: Fix incorrect backward compatibility setting for openstep version. + * Source/NSObject.m: minor tweak ... put debugging code in the object + reference counting function rather than the release method. + * Source/NSConnection.m: Change release implementation for better + protection of global connection table management. 2006-09-06 Richard Frith-Macdonald diff --git a/Source/NSConnection.m b/Source/NSConnection.m index e23abd968..5d6be8996 100644 --- a/Source/NSConnection.m +++ b/Source/NSConnection.m @@ -701,6 +701,7 @@ static NSLock *cached_proxies_gate = nil; { if (debug_connection) NSLog(@"deallocating %@", self); + [self gcFinalize]; [super dealloc]; } @@ -1279,26 +1280,24 @@ static NSLock *cached_proxies_gate = nil; - (void) release { - /* - * If this would cause the connection to be deallocated then we - * must perform all necessary work (done in [-gcFinalize]). - * - * We bracket the code with a retain and release so that any - * retain/release pairs in the code won't cause recursion. - * - * We lock the connection table while checking, to prevent - * another thread from grabbing this connection while we are - * finalizing/deallocating it. + /* We lock the connection table while checking, to prevent + * another thread from grabbing this connection while we are + * checking it. + * If we are going to deallocate the object, we first remove + * it from the table so that no other thread will find it + * and try to use it while it is being deallocated. */ M_LOCK(connection_table_gate); - if ([self retainCount] == 1) + if (NSDecrementExtraRefCountWasZero(self)) { - [super retain]; - [self gcFinalize]; - [super release]; + NSHashRemove(connection_table, self); + M_UNLOCK(connection_table_gate); + [self dealloc]; + } + else + { + M_UNLOCK(connection_table_gate); } - M_UNLOCK(connection_table_gate); - [super release]; } /** diff --git a/Source/NSObject.m b/Source/NSObject.m index 2e0e10656..83c54b008 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -65,6 +65,20 @@ extern BOOL __objc_responds_to(id, SEL); #endif +/* When this is `YES', every call to release/autorelease, checks to + make sure isn't being set up to release itself too many times. + This does not need mutex protection. */ +static BOOL double_release_check_enabled = NO; + +/* The Class responsible for handling autorelease's. This does not + need mutex protection, since it is simply a pointer that gets read + and set. */ +static id autorelease_class = nil; +static SEL autorelease_sel; +static IMP autorelease_imp; + + + #if GS_WITH_GC #include @@ -242,12 +256,21 @@ static GSIMapTable_t retain_counts = {0}; * (and hence whether the extra reference count was decremented).
* This function is used by the [NSObject-release] method. */ -inline BOOL +BOOL NSDecrementExtraRefCountWasZero(id anObject) { #if GS_WITH_GC return NO; #else /* GS_WITH_GC */ + if (double_release_check_enabled) + { + unsigned release_count; + unsigned retain_count = [anObject retainCount]; + release_count = [autorelease_class autoreleaseCountForObject: anObject]; + if (release_count >= retain_count) + [NSException raise: NSGenericException + format: @"Release would release object too many times."]; + } #if defined(REFCNT_LOCAL) if (allocationLock != 0) { @@ -696,20 +719,6 @@ NSShouldRetainWithZone (NSObject *anObject, NSZone *requestedZone) -/* The Class responsible for handling autorelease's. This does not - need mutex protection, since it is simply a pointer that gets read - and set. */ -static id autorelease_class = nil; -static SEL autorelease_sel; -static IMP autorelease_imp; - -/* When this is `YES', every call to release/autorelease, checks to - make sure isn't being set up to release itself too many times. - This does not need mutex protection. */ -static BOOL double_release_check_enabled = NO; - - - struct objc_method_description_list { int count; struct objc_method_description list[1]; @@ -1828,16 +1837,6 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) - (oneway void) release { #if GS_WITH_GC == 0 - if (double_release_check_enabled) - { - unsigned release_count; - unsigned retain_count = [self retainCount]; - release_count = [autorelease_class autoreleaseCountForObject:self]; - if (release_count >= retain_count) - [NSException raise: NSGenericException - format: @"Release would release object too many times."]; - } - if (NSDecrementExtraRefCountWasZero(self)) { [self dealloc]; From f8cd305a8fb5f7566164e257f60394949dde1311 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sat, 9 Sep 2006 16:55:25 +0000 Subject: [PATCH 005/266] ithreading fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23442 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++ Source/win32/NSMessagePortWin32.m | 46 ++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6b90d2b9..3dee3cbee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-09 Richard Frith-Macdonald + + * Source/win32/NSMessagePortWin32.m: Restructure to try to avoid + deadlock reported by Wim. Also implement -release to remove port + from name table so that another thread can't find it in the window + between checking the refcount end deallocation. + 2006-09-07 Richard Frith-Macdonald * Headers/Foundation/NSObject.h: Fix incorrect backward compatibility diff --git a/Source/win32/NSMessagePortWin32.m b/Source/win32/NSMessagePortWin32.m index aada0bdda..102cd238e 100644 --- a/Source/win32/NSMessagePortWin32.m +++ b/Source/win32/NSMessagePortWin32.m @@ -203,11 +203,13 @@ static Class messagePortClass = 0; { p = [[self alloc] initWithName: name]; } - else - { - [p _setupSendPort]; - } M_UNLOCK(messagePortLock); + if ([self _setupSendPort] == NO) + { + NSLog(@"unable to access mailslot '%@' - %s", + p->name, GSLastErrorStr(errno)); + DESTROY(p); + } return p; } @@ -382,22 +384,12 @@ static Class messagePortClass = 0; this->wHandle = INVALID_HANDLE_VALUE; this->wEvent = INVALID_HANDLE_VALUE; - if ([self _setupSendPort] == NO) - { - NSLog(@"unable to access mailslot '%@' - %s", - this->name, GSLastErrorStr(errno)); - DESTROY(self); - } - else - { - NSMapInsert(ports, (void*)this->name, (void*)self); - NSDebugMLLog(@"NSMessagePort", @"Created speaking port: %@", self); - } + NSMapInsert(ports, (void*)this->name, (void*)self); + NSDebugMLLog(@"NSMessagePort", @"Created speaking port: %@", self); } else { RELEASE(self); - [p _setupSendPort]; self = p; } M_UNLOCK(messagePortLock); @@ -935,6 +927,28 @@ again: return sizeof(GSPortItemHeader) + sizeof(GSPortMsgHeader); } +- (void) release +{ + /* We lock the port table while checking, to prevent + * another thread from grabbing this port while we are + * checking it. + * If we are going to deallocate the object, we first remove + * it from the table so that no other thread will find it + * and try to use it while it is being deallocated. + */ + M_LOCK(messagePortLock); + if (NSDecrementExtraRefCountWasZero(self)) + { + NSMapRemove(ports, (void*)this->name); + M_UNLOCK(messagePortLock); + [self dealloc]; + } + else + { + M_UNLOCK(messagePortLock); + } +} + - (BOOL) sendBeforeDate: (NSDate*)when msgid: (int)msgId components: (NSMutableArray*)components From 7d7845270274bde6e457317b9f8f35d5501d7bbc Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sat, 9 Sep 2006 17:06:16 +0000 Subject: [PATCH 006/266] Tidied last change git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23443 72102866-910b-0410-8b05-ffd578937521 --- Source/win32/NSMessagePortWin32.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/win32/NSMessagePortWin32.m b/Source/win32/NSMessagePortWin32.m index 102cd238e..19ea79d40 100644 --- a/Source/win32/NSMessagePortWin32.m +++ b/Source/win32/NSMessagePortWin32.m @@ -204,10 +204,10 @@ static Class messagePortClass = 0; p = [[self alloc] initWithName: name]; } M_UNLOCK(messagePortLock); - if ([self _setupSendPort] == NO) + if ([p _setupSendPort] == NO) { NSLog(@"unable to access mailslot '%@' - %s", - p->name, GSLastErrorStr(errno)); + [p name], GSLastErrorStr(errno)); DESTROY(p); } return p; @@ -939,7 +939,7 @@ again: M_LOCK(messagePortLock); if (NSDecrementExtraRefCountWasZero(self)) { - NSMapRemove(ports, (void*)this->name); + NSMapRemove(ports, (void*)[self name]); M_UNLOCK(messagePortLock); [self dealloc]; } From 97d73ea53f724e4af40de161c1f48ebe45e78d05 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sun, 10 Sep 2006 07:27:59 +0000 Subject: [PATCH 007/266] remove unnecessary check git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23444 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSTimeZone.m | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3dee3cbee..c6022f9d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-10 Richard Frith-Macdonald + + * Source/NSTimeZone.m: Remove unnecessary check on fiel name as + Roland Schwingel reported that it caught legitimate files on windows. + 2006-09-09 Richard Frith-Macdonald * Source/win32/NSMessagePortWin32.m: Restructure to try to avoid diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m index 9dae3f8f1..45828e873 100644 --- a/Source/NSTimeZone.m +++ b/Source/NSTimeZone.m @@ -464,15 +464,6 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type) if (data == nil) { NSString *fileName; - const char *str = [name UTF8String]; - - /* Make sure that only time zone files are accessed. - FIXME: Make this more robust. */ - if ((str)[0] == '/' || strchr(str, '.') != NULL) - { - NSLog(@"Disallowed time zone name `%@'.", name); - return nil; - } fileName = [NSTimeZoneClass getTimeZoneFile: name]; if (fileName == nil From d9370ba9d8b8d12a3a524b8bfd102637c128e3c8 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sun, 10 Sep 2006 10:47:50 +0000 Subject: [PATCH 008/266] Thread safety fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23445 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 ++++ Source/NSMessagePort.m | 19 +++++++++++++-- Source/NSSocketPort.m | 53 +++++++++++++++++++++++++++++++----------- 3 files changed, 62 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6022f9d4..259c727e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ * Source/NSTimeZone.m: Remove unnecessary check on fiel name as Roland Schwingel reported that it caught legitimate files on windows. + * Source/NSMessagePort.m: + * Source/NSSocketPort.m: + Protect -release with lock and remove port from gloibal table within + protected region, to avoid possible double deallocation in a + multithreaded process. 2006-09-09 Richard Frith-Macdonald diff --git a/Source/NSMessagePort.m b/Source/NSMessagePort.m index 73205cc44..9d7a6582c 100644 --- a/Source/NSMessagePort.m +++ b/Source/NSMessagePort.m @@ -1574,14 +1574,14 @@ typedef struct { unsigned i; M_LOCK(messagePortLock); + NSMapRemove(messagePortMap, (void*)name); + M_UNLOCK(messagePortLock); if (lDesc >= 0) { (void) close(lDesc); unlink([name bytes]); lDesc = -1; } - NSMapRemove(messagePortMap, (void*)name); - M_UNLOCK(messagePortLock); if (handles != 0) { @@ -1691,6 +1691,21 @@ typedef struct { } } +- (void) release +{ + M_LOCK(messagePortLock); + if (NSDecrementExtraRefCountWasZero(self)) + { + NSMapRemove(messagePortMap, (void*)name); + M_UNLOCK(messagePortLock); + [self dealloc]; + } + else + { + M_UNLOCK(messagePortLock); + } +} + - (void) removeHandle: (GSMessageHandle*)handle { M_LOCK(myLock); diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m index 98ab968c8..428679c92 100644 --- a/Source/NSSocketPort.m +++ b/Source/NSSocketPort.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "config.h" @@ -1693,7 +1694,8 @@ static Class tcpPortClass; NSLog(@"Invalid Event - '%d'", WSAGetLastError()); abort(); } - rc = WSAEventSelect(port->listener, port->eventListener, FD_ACCEPT); + rc = WSAEventSelect(port->listener, + port->eventListener, FD_ACCEPT); NSAssert(rc == 0, @"WSAEventSelect failed!"); #endif /* @@ -1725,7 +1727,8 @@ static Class tcpPortClass; * Make sure we have the map table for this port. */ port->portNum = number; - thePorts = (NSMapTable*)NSMapGet(tcpPortMap, (void*)(uintptr_t)number); + thePorts + = (NSMapTable*)NSMapGet(tcpPortMap, (void*)(uintptr_t)number); if (thePorts == 0) { /* @@ -1734,7 +1737,8 @@ static Class tcpPortClass; */ thePorts = NSCreateMapTable(NSIntMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0); - NSMapInsert(tcpPortMap, (void*)(uintptr_t)number, (void*)thePorts); + NSMapInsert(tcpPortMap, + (void*)(uintptr_t)number, (void*)thePorts); } /* * Record the port by host. @@ -2057,19 +2061,20 @@ static Class tcpPortClass; thePorts = NSMapGet(tcpPortMap, (void*)(uintptr_t)portNum); if (thePorts != 0) { - if (listener >= 0) - { - (void) close(listener); - listener = -1; -#if defined(__MINGW32__) - WSACloseEvent(eventListener); - eventListener = WSA_INVALID_EVENT; -#endif - } NSMapRemove(thePorts, (void*)host); } M_UNLOCK(tcpPortLock); + if (listener >= 0) + { + (void) close(listener); + listener = -1; +#if defined(__MINGW32__) + WSACloseEvent(eventListener); + eventListener = WSA_INVALID_EVENT; +#endif + } + if (handles != 0) { handleArray = NSAllMapTableValues(handles); @@ -2216,6 +2221,28 @@ static Class tcpPortClass; } } +- (void) release +{ + M_LOCK(tcpPortLock); + if (NSDecrementExtraRefCountWasZero(self)) + { + NSMapTable *thePorts; + + thePorts = NSMapGet(tcpPortMap, (void*)(uintptr_t)portNum); + if (thePorts != 0) + { + NSMapRemove(thePorts, host); + } + M_UNLOCK(tcpPortLock); + [self dealloc]; + } + else + { + M_UNLOCK(tcpPortLock); + } +} + + /* * This is called when a tcp/ip socket connection is broken. We remove the * connection handle from this port and, if this was the last handle to a From f03b968a46d04d0b953e521d34efeea4d240bc1a Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sun, 10 Sep 2006 13:30:05 +0000 Subject: [PATCH 009/266] more threading fixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23448 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 +++- Source/NSBundle.m | 13 +++++++++++++ Source/NSIndexPath.m | 25 +++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 259c727e5..74d7096e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,9 @@ Roland Schwingel reported that it caught legitimate files on windows. * Source/NSMessagePort.m: * Source/NSSocketPort.m: - Protect -release with lock and remove port from gloibal table within + * Source/NSIndexPath.m: + * Source/NSBundle.m: + Protect -release with lock and remove object from global table within protected region, to avoid possible double deallocation in a multithreaded process. diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 35395091a..1a251f582 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -1428,6 +1428,19 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) return YES; } +- (void) release +{ + /* We lock during release so that other threads can't grab the + * object between us checking the reference count and deallocating. + */ + [load_lock lock]; + if (NSDecrementExtraRefCountWasZero(self)) + { + [self dealloc]; + } + [load_lock unlock]; +} + /* This method is the backbone of the resource searching for NSBundle. It constructs an array of paths, where each path is a possible location for a resource in the bundle. The current algorithm for searching goes: diff --git a/Source/NSIndexPath.m b/Source/NSIndexPath.m index f739b011c..ff34d2251 100644 --- a/Source/NSIndexPath.m +++ b/Source/NSIndexPath.m @@ -31,6 +31,7 @@ #include #include #include +#include "GNUstepBase/GSLock.h" static NSLock *lock = nil; static NSHashTable *shared = 0; @@ -72,7 +73,7 @@ static NSIndexPath *dummy = nil; dummy = (NSIndexPath*)NSAllocateObject(self, 0, NSDefaultMallocZone()); shared = NSCreateHashTable(NSNonRetainedObjectHashCallBacks, 1024); NSHashInsert(shared, empty); - lock = [NSLock new]; + lock = [GSLazyRecursiveLock new]; } } @@ -130,7 +131,7 @@ static NSIndexPath *dummy = nil; GSNOSUPERDEALLOC; } -- (NSString*)description +- (NSString*) description { NSMutableString *m = [[super description] mutableCopy]; unsigned i; @@ -425,5 +426,25 @@ static NSIndexPath *dummy = nil; return _length; } +- (void) release +{ + if (self != empty) + { + /* We lock the table while checking, to prevent + * another thread from grabbing this object while we are + * checking it. + * If we are going to deallocate the object, we first remove + * it from the table so that no other thread will find it + * and try to use it while it is being deallocated. + */ + [lock lock]; + if (NSDecrementExtraRefCountWasZero(self)) + { + [self dealloc]; + } + [lock unlock]; + } +} + @end From 8c9c0bbaea38ab3ae6cbf604d7950a7aff96f943 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sun, 10 Sep 2006 16:07:08 +0000 Subject: [PATCH 010/266] if socklen_t is not defined, assume uint32_t git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23451 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 1 + Source/unix/NSStream.m | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 74d7096e7..3480c2d84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Protect -release with lock and remove object from global table within protected region, to avoid possible double deallocation in a multithreaded process. + * Source/unix/NSStream.m: If socklen_t is not defined, assume uint32_t 2006-09-09 Richard Frith-Macdonald diff --git a/Source/unix/NSStream.m b/Source/unix/NSStream.m index 099f52a64..669db8609 100644 --- a/Source/unix/NSStream.m +++ b/Source/unix/NSStream.m @@ -50,6 +50,10 @@ #define PF_LOCAL PF_UNIX #endif +#ifndef socklen_t +#define socklen_t uint32_t +#endif + /** * The concrete subclass of NSInputStream that reads from a file */ From e176abe6218f4b5b575120bcd22b90098dcc16b1 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 13 Sep 2006 05:32:53 +0000 Subject: [PATCH 011/266] better error case decoding corrupt encoded word in header git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23485 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/Additions/GSMime.m | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3480c2d84..cf18b560b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-13 Richard Frith-Macdonald + + * Source/Additions/GSMime.m: When decoding a corrupt encoded word + in a header, abandon processing of the header without appending + any decoded data. + 2006-09-10 Richard Frith-Macdonald * Source/NSTimeZone.m: Remove unnecessary check on fiel name as diff --git a/Source/Additions/GSMime.m b/Source/Additions/GSMime.m index 13c3835e2..73db2f33d 100644 --- a/Source/Additions/GSMime.m +++ b/Source/Additions/GSMime.m @@ -2312,12 +2312,13 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info); } dst = decodeWord(dst, src, tmp, encoding); tmp++; + src = tmp; if (*tmp != '=') { NSLog(@"Bad encoded word - encoded word terminator missing"); + dst = beg; // Don't append to string. break; } - src = tmp; if (dst > beg) { s = [NSStringClass allocWithZone: NSDefaultMallocZone()]; From 79c2ae503c8d31e0ab0c3a45d99f4cf9e86352c2 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 13 Sep 2006 07:31:38 +0000 Subject: [PATCH 012/266] Implement missing method git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23487 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 3 +++ Headers/Foundation/NSBundle.h | 33 +++++++++++++---------- Source/NSBundle.m | 49 ++++++++++++++++++++++++++++------- 3 files changed, 61 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf18b560b..8a55d02f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * Source/Additions/GSMime.m: When decoding a corrupt encoded word in a header, abandon processing of the header without appending any decoded data. + * Headers/Foundation/NSBundle.h: + * Source/NSBundle.m: + ([pathForResource:ofType:inDirectory:forLocalization:]) implement. 2006-09-10 Richard Frith-Macdonald diff --git a/Headers/Foundation/NSBundle.h b/Headers/Foundation/NSBundle.h index c1e30aa5f..ab7362759 100644 --- a/Headers/Foundation/NSBundle.h +++ b/Headers/Foundation/NSBundle.h @@ -322,16 +322,20 @@ GS_EXPORT NSString* const NSLoadedClasses; - (BOOL) isLoaded; /** - This method returns the same information as - -pathsForResourcesOfType:inDirectory: except that only non-localized - resources and resources that match the localization localizationName - are returned. + * This method returns the same information as + * -pathsForResourcesOfType:inDirectory: except that only non-localized + * resources and resources that match the localization localizationName + * are returned.
+ * The GNUstep implementation places localised resources in the array + * before any non-localised resources. */ - (NSArray*) pathsForResourcesOfType: (NSString*)extension inDirectory: (NSString*)subPath forLocalization: (NSString*)localizationName; /** - * Not implemented. + * This is like -pathForResource:ofType:inDirectory: but returns only + * resources matching localizationName (preferentially), or non-localized + * resources. */ - (NSString*) pathForResource: (NSString*)name ofType: (NSString*)ext @@ -342,18 +346,19 @@ GS_EXPORT NSString* const NSLoadedClasses; - (NSDictionary*) infoDictionary; /** Returns a localized info property list based on the preferred - localization or the most appropriate localization if the preferred - one cannot be found. -*/ -- (NSDictionary *)localizedInfoDictionary; + * localization or the most appropriate localization if the preferred + * one cannot be found. + */ +- (NSDictionary*) localizedInfoDictionary; /** Returns all the localizations in the bundle. */ -- (NSArray *)localizations; +- (NSArray*) localizations; -/** Returns the list of localizations that the bundle uses to search - for information. This is based on the user's preferences. -*/ -- (NSArray *)preferredLocalizations; +/** + * Returns the list of localizations that the bundle uses to search + * for information. This is based on the user's preferences. + */ +- (NSArray*) preferredLocalizations; /** Loads any executable code contained in the bundle into the application. Load will be called implicitly if any information diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 1a251f582..ce9ec9dfb 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -1597,7 +1597,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) } + (NSArray*) _pathsForResourcesOfType: (NSString*)extension - inRootDirectory: (NSString*)bundlePath + inRootDirectory: (NSString*)bundlePath inSubDirectory: (NSString *)subPath { BOOL allfiles; @@ -1657,18 +1657,21 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) inDirectory: subPath]; enumerator = [paths objectEnumerator]; - while( (path = [enumerator nextObject]) ) + while ((path = [enumerator nextObject]) != nil) { /* Add all non-localized paths, plus ones in the particular localization (if there is one). */ NSString *theDir = [path stringByDeletingLastPathComponent]; - if ([[theDir pathExtension] isEqual: @"lproj"] == NO - || (localizationName != nil - && [localizationName length] != 0 - && [[theDir lastPathComponent] hasPrefix: localizationName]) ) - { + + if ([[theDir pathExtension] isEqual: @"lproj"] == NO) + { [result addObject: path]; } + else if ([localizationName length] > 0 + && [[theDir lastPathComponent] hasPrefix: localizationName]) + { + [result insertObject: path atIndex: 0]; + } } return result; @@ -1679,8 +1682,34 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) inDirectory: (NSString*)subPath forLocalization: (NSString*)localizationName { - [self notImplemented: _cmd]; - return nil; + CREATE_AUTORELEASE_POOL(arp); + NSString *result = nil; + NSArray *array; + + array = [self pathsForResourcesOfType: ext + inDirectory: subPath + forLocalization: localizationName]; + + if (array != nil) + { + NSEnumerator *enumerator = [array objectEnumerator]; + NSString *path; + + name = [name stringByAppendingPathExtension: ext]; + while ((path = [enumerator nextObject]) != nil) + { + NSString *found = [path lastPathComponent]; + + if ([found isEqualToString: name] == YES) + { + result = path; + break; // localised paths occur before non-localised + } + } + } + RETAIN(result); + DESTROY(arp); + return AUTORELEASE(result); } + (NSArray *) preferredLocalizationsFromArray: (NSArray *)localizationsArray @@ -1709,7 +1738,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) return [array makeImmutableCopyOnFail: NO]; } -- (NSDictionary *)localizedInfoDictionary +- (NSDictionary*) localizedInfoDictionary { NSString *path; NSArray *locales; From f645b8419645f6067cf67541b3c72393a8fc4880 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 13 Sep 2006 10:20:49 +0000 Subject: [PATCH 013/266] Resolve bug 17464 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23488 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 112 ++++++++++++++++++ .../GNUstepBase/DistributedObjects.h | 3 +- Headers/Additions/GNUstepBase/GCObject.h | 11 +- Headers/Additions/GNUstepBase/GNUstep.h | 3 +- Headers/Additions/GNUstepBase/GSCategories.h | 8 ++ Headers/Additions/GNUstepBase/GSFileHandle.h | 3 +- Headers/Additions/GNUstepBase/GSFunctions.h | 11 +- Headers/Additions/GNUstepBase/GSIArray.h | 12 +- Headers/Additions/GNUstepBase/GSIMap.h | 11 +- Headers/Additions/GNUstepBase/GSLocale.h | 11 +- Headers/Additions/GNUstepBase/GSLock.h | 13 +- Headers/Additions/GNUstepBase/GSMime.h | 8 ++ Headers/Additions/GNUstepBase/GSObjCRuntime.h | 3 +- Headers/Additions/GNUstepBase/GSUnion.h | 3 +- Headers/Additions/GNUstepBase/GSXML.h | 11 +- Headers/Additions/GNUstepBase/Unicode.h | 8 ++ Headers/Additions/GNUstepBase/behavior.h | 11 +- Headers/Additions/GNUstepBase/objc-gnu2next.h | 8 ++ Headers/Foundation/NSArchiver.h | 11 +- Headers/Foundation/NSArray.h | 11 +- Headers/Foundation/NSAttributedString.h | 17 ++- Headers/Foundation/NSAutoreleasePool.h | 8 ++ Headers/Foundation/NSBundle.h | 11 +- Headers/Foundation/NSByteOrder.h | 7 ++ Headers/Foundation/NSCalendarDate.h | 11 +- Headers/Foundation/NSCharacterSet.h | 8 ++ Headers/Foundation/NSClassDescription.h | 8 ++ Headers/Foundation/NSCoder.h | 8 ++ Headers/Foundation/NSComparisonPredicate.h | 8 ++ Headers/Foundation/NSCompoundPredicate.h | 9 ++ Headers/Foundation/NSConnection.h | 8 ++ Headers/Foundation/NSData.h | 12 +- Headers/Foundation/NSDate.h | 8 ++ Headers/Foundation/NSDateFormatter.h | 8 ++ Headers/Foundation/NSDebug.h | 8 ++ Headers/Foundation/NSDecimal.h | 8 ++ Headers/Foundation/NSDecimalNumber.h | 8 ++ Headers/Foundation/NSDictionary.h | 8 ++ Headers/Foundation/NSDistantObject.h | 8 ++ Headers/Foundation/NSDistributedLock.h | 8 ++ .../NSDistributedNotificationCenter.h | 8 ++ Headers/Foundation/NSEnumerator.h | 8 ++ Headers/Foundation/NSError.h | 8 ++ Headers/Foundation/NSException.h | 8 ++ Headers/Foundation/NSExpression.h | 9 ++ Headers/Foundation/NSFileHandle.h | 8 ++ Headers/Foundation/NSFileManager.h | 11 +- Headers/Foundation/NSFormatter.h | 8 ++ Headers/Foundation/NSGeometry.h | 9 ++ Headers/Foundation/NSHTTPCookie.h | 9 ++ Headers/Foundation/NSHTTPCookieStorage.h | 9 ++ Headers/Foundation/NSHashTable.h | 8 ++ Headers/Foundation/NSHost.h | 8 ++ Headers/Foundation/NSIndexPath.h | 8 ++ Headers/Foundation/NSIndexSet.h | 8 ++ Headers/Foundation/NSInvocation.h | 8 +- Headers/Foundation/NSKeyValueCoding.h | 9 ++ Headers/Foundation/NSKeyValueObserving.h | 9 ++ Headers/Foundation/NSKeyedArchiver.h | 8 ++ Headers/Foundation/NSLock.h | 11 +- Headers/Foundation/NSMapTable.h | 8 ++ Headers/Foundation/NSMethodSignature.h | 8 ++ Headers/Foundation/NSNotification.h | 16 +-- Headers/Foundation/NSNotificationQueue.h | 8 ++ Headers/Foundation/NSNull.h | 8 ++ Headers/Foundation/NSNumberFormatter.h | 8 ++ Headers/Foundation/NSObjCRuntime.h | 8 ++ Headers/Foundation/NSObject.h | 8 ++ Headers/Foundation/NSPathUtilities.h | 8 ++ Headers/Foundation/NSPort.h | 8 ++ Headers/Foundation/NSPortCoder.h | 8 ++ Headers/Foundation/NSPortMessage.h | 8 ++ Headers/Foundation/NSPortNameServer.h | 8 ++ Headers/Foundation/NSPredicate.h | 8 ++ Headers/Foundation/NSProcessInfo.h | 8 ++ Headers/Foundation/NSPropertyList.h | 13 +- Headers/Foundation/NSProtocolChecker.h | 8 ++ Headers/Foundation/NSProxy.h | 8 ++ Headers/Foundation/NSRange.h | 8 ++ Headers/Foundation/NSRunLoop.h | 8 ++ Headers/Foundation/NSScanner.h | 8 ++ Headers/Foundation/NSSerialization.h | 8 ++ Headers/Foundation/NSSet.h | 8 ++ Headers/Foundation/NSSortDescriptor.h | 8 ++ Headers/Foundation/NSStream.h | 8 ++ Headers/Foundation/NSString.h | 8 ++ Headers/Foundation/NSTask.h | 8 ++ Headers/Foundation/NSThread.h | 8 ++ Headers/Foundation/NSTimeZone.h | 8 ++ Headers/Foundation/NSTimer.h | 8 ++ Headers/Foundation/NSURL.h | 8 ++ .../Foundation/NSURLAuthenticationChallenge.h | 9 ++ Headers/Foundation/NSURLCache.h | 9 ++ Headers/Foundation/NSURLConnection.h | 9 ++ Headers/Foundation/NSURLCredential.h | 9 ++ Headers/Foundation/NSURLCredentialStorage.h | 9 ++ Headers/Foundation/NSURLDownload.h | 9 ++ Headers/Foundation/NSURLError.h | 9 ++ Headers/Foundation/NSURLHandle.h | 8 ++ Headers/Foundation/NSURLProtectionSpace.h | 9 ++ Headers/Foundation/NSURLProtocol.h | 9 ++ Headers/Foundation/NSURLRequest.h | 9 ++ Headers/Foundation/NSURLResponse.h | 9 ++ Headers/Foundation/NSUndoManager.h | 8 ++ Headers/Foundation/NSUserDefaults.h | 8 ++ Headers/Foundation/NSValue.h | 8 ++ Headers/Foundation/NSXMLParser.h | 8 ++ Headers/Foundation/NSZone.h | 8 ++ Source/NSNotificationCenter.m | 45 +------ 109 files changed, 994 insertions(+), 82 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a55d02f7..826126f38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,115 @@ +2006-09-13 Richard Frith-Macdonald + + * Headers/Foundation/NSTimeZone.h: + * Headers/Foundation/NSHashTable.h: + * Headers/Foundation/NSRange.h: + * Headers/Foundation/NSCoder.h: + * Headers/Foundation/NSURLCredential.h: + * Headers/Foundation/NSHTTPCookieStorage.h: + * Headers/Foundation/NSException.h: + * Headers/Foundation/NSByteOrder.h: + * Headers/Foundation/NSPortCoder.h: + * Headers/Foundation/NSURL.h: + * Headers/Foundation/NSCompoundPredicate.h: + * Headers/Foundation/NSURLAuthenticationChallenge.h: + * Headers/Foundation/NSString.h: + * Headers/Foundation/NSObject.h: + * Headers/Foundation/NSCalendarDate.h: + * Headers/Foundation/NSDecimalNumber.h: + * Headers/Foundation/NSBundle.h: + * Headers/Foundation/NSKeyValueCoding.h: + * Headers/Foundation/NSSerialization.h: + * Headers/Foundation/NSURLHandle.h: + * Headers/Foundation/NSPropertyList.h: + * Headers/Foundation/NSTimer.h: + * Headers/Foundation/NSNotification.h: + * Headers/Foundation/NSPathUtilities.h: + * Headers/Foundation/NSScanner.h: + * Headers/Foundation/NSProcessInfo.h: + * Headers/Foundation/NSDistributedNotificationCenter.h: + * Headers/Foundation/NSNotificationQueue.h: + * Headers/Foundation/NSGeometry.h: + * Headers/Foundation/NSStream.h: + * Headers/Foundation/NSComparisonPredicate.h: + * Headers/Foundation/NSDecimal.h: + * Headers/Foundation/NSRunLoop.h: + * Headers/Foundation/NSAttributedString.h: + * Headers/Foundation/NSConnection.h: + * Headers/Foundation/NSUndoManager.h: + * Headers/Foundation/NSDateFormatter.h: + * Headers/Foundation/NSMethodSignature.h: + * Headers/Foundation/NSAutoreleasePool.h: + * Headers/Foundation/NSFormatter.h: + * Headers/Foundation/NSUserDefaults.h: + * Headers/Foundation/NSThread.h: + * Headers/Foundation/NSHTTPCookie.h: + * Headers/Foundation/NSData.h: + * Headers/Foundation/NSURLError.h: + * Headers/Foundation/NSDate.h: + * Headers/Foundation/NSHost.h: + * Headers/Foundation/NSArray.h: + * Headers/Foundation/NSProxy.h: + * Headers/Foundation/NSObjCRuntime.h: + * Headers/Foundation/NSURLProtectionSpace.h: + * Headers/Foundation/NSKeyedArchiver.h: + * Headers/Foundation/NSProtocolChecker.h: + * Headers/Foundation/NSDebug.h: + * Headers/Foundation/NSPortMessage.h: + * Headers/Foundation/NSError.h: + * Headers/Foundation/NSURLDownload.h: + * Headers/Foundation/NSDistributedLock.h: + * Headers/Foundation/NSFileHandle.h: + * Headers/Foundation/NSPredicate.h: + * Headers/Foundation/NSKeyValueObserving.h: + * Headers/Foundation/NSDictionary.h: + * Headers/Foundation/NSClassDescription.h: + * Headers/Foundation/NSNull.h: + * Headers/Foundation/NSZone.h: + * Headers/Foundation/NSURLRequest.h: + * Headers/Foundation/NSValue.h: + * Headers/Foundation/NSURLCredentialStorage.h: + * Headers/Foundation/NSIndexSet.h: + * Headers/Foundation/NSPort.h: + * Headers/Foundation/NSSortDescriptor.h: + * Headers/Foundation/NSLock.h: + * Headers/Foundation/NSSet.h: + * Headers/Foundation/NSDistantObject.h: + * Headers/Foundation/NSExpression.h: + * Headers/Foundation/NSTask.h: + * Headers/Foundation/NSArchiver.h: + * Headers/Foundation/NSCharacterSet.h: + * Headers/Foundation/NSInvocation.h: + * Headers/Foundation/NSFileManager.h: + * Headers/Foundation/NSPortNameServer.h: + * Headers/Foundation/NSNumberFormatter.h: + * Headers/Foundation/NSXMLParser.h: + * Headers/Foundation/NSEnumerator.h: + * Headers/Foundation/NSURLResponse.h: + * Headers/Foundation/NSURLConnection.h: + * Headers/Foundation/NSIndexPath.h: + * Headers/Foundation/NSURLProtocol.h: + * Headers/Foundation/NSMapTable.h: + * Headers/Foundation/NSURLCache.h: + * Headers/Additions/GNUstepBase/GSLocale.h: + * Headers/Additions/GNUstepBase/GSXML.h: + * Headers/Additions/GNUstepBase/DistributedObjects.h: + * Headers/Additions/GNUstepBase/behavior.h: + * Headers/Additions/GNUstepBase/GSFunctions.h: + * Headers/Additions/GNUstepBase/GSObjCRuntime.h: + * Headers/Additions/GNUstepBase/GSCategories.h: + * Headers/Additions/GNUstepBase/GCObject.h: + * Headers/Additions/GNUstepBase/GSIMap.h: + * Headers/Additions/GNUstepBase/GSIArray.h: + * Headers/Additions/GNUstepBase/GSMime.h: + * Headers/Additions/GNUstepBase/GSUnion.h: + * Headers/Additions/GNUstepBase/GSLock.h: + * Headers/Additions/GNUstepBase/GSFileHandle.h: + * Headers/Additions/GNUstepBase/GNUstep.h: + * Headers/Additions/GNUstepBase/objc-gnu2next.h: + * Headers/Additions/GNUstepBase/Unicode.h: + Bracket with 'extern "C"' for inclusion in Objective-C++ programs. + * Source/NSNotificationCenter.m: Remove deprecated method. + 2006-09-13 Richard Frith-Macdonald * Source/Additions/GSMime.m: When decoding a corrupt encoded word diff --git a/Headers/Additions/GNUstepBase/DistributedObjects.h b/Headers/Additions/GNUstepBase/DistributedObjects.h index a05215f32..42c9384d2 100644 --- a/Headers/Additions/GNUstepBase/DistributedObjects.h +++ b/Headers/Additions/GNUstepBase/DistributedObjects.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef __DistributedObjects_h diff --git a/Headers/Additions/GNUstepBase/GCObject.h b/Headers/Additions/GNUstepBase/GCObject.h index a7a7d36e2..d42da2c45 100644 --- a/Headers/Additions/GNUstepBase/GCObject.h +++ b/Headers/Additions/GNUstepBase/GCObject.h @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource: Additions/GCObject.m AutogsdocSource: Additions/GCArray.m @@ -39,6 +40,10 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + @class GCObject; @@ -110,4 +115,8 @@ typedef struct { } @end +#if defined(__cplusplus) +} +#endif + #endif /* __INCLUDED_GCOBJECT_H */ diff --git a/Headers/Additions/GNUstepBase/GNUstep.h b/Headers/Additions/GNUstepBase/GNUstep.h index acbbe7ad0..550a43e29 100644 --- a/Headers/Additions/GNUstepBase/GNUstep.h +++ b/Headers/Additions/GNUstepBase/GNUstep.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ #ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_ diff --git a/Headers/Additions/GNUstepBase/GSCategories.h b/Headers/Additions/GNUstepBase/GSCategories.h index 9e7cb6c5d..b80ffd441 100644 --- a/Headers/Additions/GNUstepBase/GSCategories.h +++ b/Headers/Additions/GNUstepBase/GSCategories.h @@ -49,6 +49,10 @@ #include "GNUstepBase/GSObjCRuntime.h" #include "GNUstepBase/GNUstep.h" +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableSet; @@ -342,6 +346,10 @@ GS_EXPORT NSString *GSDebugMethodMsg(id obj, SEL sel, const char *file, GS_EXPORT NSString *GSDebugFunctionMsg(const char *func, const char *file, int line, NSString *fmt); +#if defined(__cplusplus) +} +#endif + #endif /* GNUSTEP */ #endif /* INCLUDED_GS_CATEGORIES_H */ diff --git a/Headers/Additions/GNUstepBase/GSFileHandle.h b/Headers/Additions/GNUstepBase/GSFileHandle.h index 880ccc1ad..7eb2ba3e3 100644 --- a/Headers/Additions/GNUstepBase/GSFileHandle.h +++ b/Headers/Additions/GNUstepBase/GSFileHandle.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef __GSFileHandle_h_GNUSTEP_BASE_INCLUDE diff --git a/Headers/Additions/GNUstepBase/GSFunctions.h b/Headers/Additions/GNUstepBase/GSFunctions.h index c544a1dfe..22d916b58 100644 --- a/Headers/Additions/GNUstepBase/GSFunctions.h +++ b/Headers/Additions/GNUstepBase/GSFunctions.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource: Additions/GSFunctions.m */ @@ -30,6 +31,10 @@ #include "GNUstepBase/GSObjCRuntime.h" #include "GNUstepBase/GNUstep.h" +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSString; @@ -40,4 +45,8 @@ GS_EXPORT NSString *GSFindNamedFile(NSArray *paths, NSString *aName, NSString *anExtension); +#if defined(__cplusplus) +} +#endif + #endif /* __NSPathUtilities_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Additions/GNUstepBase/GSIArray.h b/Headers/Additions/GNUstepBase/GSIArray.h index 88bebb56d..a002b4247 100644 --- a/Headers/Additions/GNUstepBase/GSIArray.h +++ b/Headers/Additions/GNUstepBase/GSIArray.h @@ -18,11 +18,16 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. */ + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02111 USA. */ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /* To easily un-inline functions for debugging */ #ifndef INLINE #define INLINE inline @@ -544,3 +549,8 @@ GSIArrayCopyWithZone(GSIArray array, NSZone *zone) } return new; } + +#if defined(__cplusplus) +} +#endif + diff --git a/Headers/Additions/GNUstepBase/GSIMap.h b/Headers/Additions/GNUstepBase/GSIMap.h index 6a73f46f0..2c0c253dd 100644 --- a/Headers/Additions/GNUstepBase/GSIMap.h +++ b/Headers/Additions/GNUstepBase/GSIMap.h @@ -20,11 +20,16 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. */ + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02111 USA. */ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /* To easily un-inline functions for debugging */ #ifndef INLINE #define INLINE inline @@ -919,3 +924,7 @@ GSIMapInitWithZoneAndCapacity(GSIMapTable map, NSZone *zone, size_t capacity) GSIMapMoreNodes(map, capacity); } +#if defined(__cplusplus) +} +#endif + diff --git a/Headers/Additions/GNUstepBase/GSLocale.h b/Headers/Additions/GNUstepBase/GSLocale.h index 6ebe91fe2..281af578d 100644 --- a/Headers/Additions/GNUstepBase/GSLocale.h +++ b/Headers/Additions/GNUstepBase/GSLocale.h @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef __GSLocale_H_ @@ -32,6 +33,10 @@ #endif #include "GSObjCRuntime.h" +#if defined(__cplusplus) +extern "C" { +#endif + @class NSDictionary; GS_EXPORT const char *GSSetLocaleC(int category, const char *loc); @@ -41,5 +46,9 @@ GS_EXPORT NSDictionary *GSDomainFromDefaultLocale(void); GS_EXPORT NSString *GSLanguageFromLocale(NSString *locale); +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Additions/GNUstepBase/GSLock.h b/Headers/Additions/GNUstepBase/GSLock.h index a2cf1df32..116d69548 100644 --- a/Headers/Additions/GNUstepBase/GSLock.h +++ b/Headers/Additions/GNUstepBase/GSLock.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource: Additions/GSLock.m @@ -33,6 +34,10 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + @class NSNotification; @interface GSLazyLock : NSLock @@ -49,6 +54,8 @@ - (void) _becomeThreaded: (NSNotification*)n; @end +#if defined(__cplusplus) +} +#endif + #endif /* INCLUDED_GS_LOCK_H */ - - diff --git a/Headers/Additions/GNUstepBase/GSMime.h b/Headers/Additions/GNUstepBase/GSMime.h index 8c9241f09..5448884c5 100644 --- a/Headers/Additions/GNUstepBase/GSMime.h +++ b/Headers/Additions/GNUstepBase/GSMime.h @@ -36,6 +36,10 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSMutableArray; @class NSData; @@ -225,4 +229,8 @@ - (void) setIsHttp; @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Additions/GNUstepBase/GSObjCRuntime.h b/Headers/Additions/GNUstepBase/GSObjCRuntime.h index b8fb118db..60b089bdf 100644 --- a/Headers/Additions/GNUstepBase/GSObjCRuntime.h +++ b/Headers/Additions/GNUstepBase/GSObjCRuntime.h @@ -20,7 +20,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource: Additions/GSObjCRuntime.m diff --git a/Headers/Additions/GNUstepBase/GSUnion.h b/Headers/Additions/GNUstepBase/GSUnion.h index f32c7d4e0..4965c62dc 100644 --- a/Headers/Additions/GNUstepBase/GSUnion.h +++ b/Headers/Additions/GNUstepBase/GSUnion.h @@ -20,7 +20,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. */ + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02111 USA. */ /* * Definitions for bitmap mask of types of element in union. diff --git a/Headers/Additions/GNUstepBase/GSXML.h b/Headers/Additions/GNUstepBase/GSXML.h index 857dd3ee1..78997e775 100644 --- a/Headers/Additions/GNUstepBase/GSXML.h +++ b/Headers/Additions/GNUstepBase/GSXML.h @@ -25,7 +25,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource: Additions/GSXML.m @@ -42,6 +43,10 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef STRICT_MACOS_X #ifndef STRICT_OPENSTEP @@ -743,5 +748,9 @@ #endif /* STRICT_MACOS_X */ #endif /* STRICT_OPENSTEP */ +#if defined(__cplusplus) +} +#endif + #endif /* __GSXML_H__ */ diff --git a/Headers/Additions/GNUstepBase/Unicode.h b/Headers/Additions/GNUstepBase/Unicode.h index abd9b6385..aab11f7ed 100644 --- a/Headers/Additions/GNUstepBase/Unicode.h +++ b/Headers/Additions/GNUstepBase/Unicode.h @@ -40,6 +40,10 @@ #ifndef NO_GNUSTEP #include "GSObjCRuntime.h" +#if defined(__cplusplus) +extern "C" { +#endif + GS_EXPORT NSStringEncoding *GetAvailableEncodings(void); GS_EXPORT NSStringEncoding GetDefEncoding(void); @@ -89,6 +93,10 @@ GS_EXPORT int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl, NSStringEncoding enc); +#if defined(__cplusplus) +} +#endif + #endif #endif /* __Unicode_h_OBJECTS_INCLUDE */ diff --git a/Headers/Additions/GNUstepBase/behavior.h b/Headers/Additions/GNUstepBase/behavior.h index 07eeb858e..e9a95bdc1 100644 --- a/Headers/Additions/GNUstepBase/behavior.h +++ b/Headers/Additions/GNUstepBase/behavior.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource: Additions/behavior.m @@ -29,6 +30,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /* Call this method from CLASS's +initialize method to add a behavior to CLASS. A "behavior" is like a protocol with an implementation. @@ -56,4 +61,8 @@ GS_EXPORT void behavior_class_add_methods (Class class, /* Set to non-zero if you want debugging messages on stderr. */ GS_EXPORT void behavior_set_debug(int i); +#if defined(__cplusplus) +} +#endif + #endif /* __behavior_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Additions/GNUstepBase/objc-gnu2next.h b/Headers/Additions/GNUstepBase/objc-gnu2next.h index eb97b8f55..788746d47 100644 --- a/Headers/Additions/GNUstepBase/objc-gnu2next.h +++ b/Headers/Additions/GNUstepBase/objc-gnu2next.h @@ -28,6 +28,10 @@ #ifndef __objc_gnu2next_h_GNUSTEP_BASE_INCLUDE #define __objc_gnu2next_h_GNUSTEP_BASE_INCLUDE +#if defined(__cplusplus) +extern "C" { +#endif + #if NeXT_RUNTIME #include @@ -283,4 +287,8 @@ objc_error_handler objc_set_error_handler(objc_error_handler func); #endif /* NeXT_RUNTIME */ +#if defined(__cplusplus) +} +#endif + #endif /* __objc_gnu2next_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSArchiver.h b/Headers/Foundation/NSArchiver.h index 8cadb53a9..93da84923 100644 --- a/Headers/Foundation/NSArchiver.h +++ b/Headers/Foundation/NSArchiver.h @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. AutogsdocSource:NSUnarchiver.m AutogsdocSource:NSArchiver.m @@ -30,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableArray, NSMutableDictionary, NSMutableData, NSData, NSString; #if OS_API_VERSION(GS_API_OSSPEC,GS_API_LATEST) @@ -222,4 +227,8 @@ GS_EXPORT NSString * const NSInconsistentArchiveException; #endif /* OS_API_VERSION */ +#if defined(__cplusplus) +} +#endif + #endif /* __NSArchiver_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSArray.h b/Headers/Foundation/NSArray.h index b8e88e5b2..4a9d30769 100644 --- a/Headers/Foundation/NSArray.h +++ b/Headers/Foundation/NSArray.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef __NSArray_h_GNUSTEP_BASE_INCLUDE @@ -27,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString; @class NSURL; @@ -173,4 +178,8 @@ usingSelector: (SEL)comp; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSArray_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSAttributedString.h b/Headers/Foundation/NSAttributedString.h index 266dedb01..604b74d24 100644 --- a/Headers/Foundation/NSAttributedString.h +++ b/Headers/Foundation/NSAttributedString.h @@ -27,7 +27,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ /* Warning - [-initWithString:attributes:] is the designated initialiser, @@ -44,8 +45,12 @@ */ -#ifndef _NSXKit_H_NSAttributedString -#define _NSXKit_H_NSAttributedString +#ifndef _NSAttributedString_H +#define _NSAttributedString_H + +#if defined(__cplusplus) +extern "C" { +#endif #ifndef STRICT_OPENSTEP #include @@ -132,5 +137,9 @@ #endif //STRICT_OPENSTEP -#endif //_NSXKit_H_NSAttributedString +#if defined(__cplusplus) +} +#endif + +#endif //NSAttributedString_H diff --git a/Headers/Foundation/NSAutoreleasePool.h b/Headers/Foundation/NSAutoreleasePool.h index c63986e60..4fdaf0d03 100644 --- a/Headers/Foundation/NSAutoreleasePool.h +++ b/Headers/Foundation/NSAutoreleasePool.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSAutoreleasePool; @class NSThread; @@ -298,4 +302,8 @@ typedef struct autorelease_array_list #endif @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSAutoreleasePool_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSBundle.h b/Headers/Foundation/NSBundle.h index ab7362759..9a00020ab 100644 --- a/Headers/Foundation/NSBundle.h +++ b/Headers/Foundation/NSBundle.h @@ -21,12 +21,17 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef __NSBundle_h_GNUSTEP_BASE_INCLUDE #define __NSBundle_h_GNUSTEP_BASE_INCLUDE +#if defined(__cplusplus) +extern "C" { +#endif + #include #include @@ -651,4 +656,8 @@ GS_EXPORT NSString* const NSLoadedClasses; #endif /* NO_GNUSTEP */ +#if defined(__cplusplus) +} +#endif + #endif /* __NSBundle_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSByteOrder.h b/Headers/Foundation/NSByteOrder.h index 3179996ab..71f8f5800 100644 --- a/Headers/Foundation/NSByteOrder.h +++ b/Headers/Foundation/NSByteOrder.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /* * OPENSTEP type definitions for Byte ordering. */ @@ -887,5 +891,8 @@ NSSwapHostShortToLittle(unsigned short num) #endif +#if defined(__cplusplus) +} +#endif #endif /* __NSByteOrder_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSCalendarDate.h b/Headers/Foundation/NSCalendarDate.h index a1331b157..0cee1c525 100644 --- a/Headers/Foundation/NSCalendarDate.h +++ b/Headers/Foundation/NSCalendarDate.h @@ -15,7 +15,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE @@ -23,6 +24,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSTimeZone; @class NSTimeZoneDetail; @@ -156,4 +161,8 @@ @end #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSCharacterSet.h b/Headers/Foundation/NSCharacterSet.h index 10427d48b..3844ef17a 100644 --- a/Headers/Foundation/NSCharacterSet.h +++ b/Headers/Foundation/NSCharacterSet.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSData; /** @@ -235,4 +239,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSCharacterSet_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSClassDescription.h b/Headers/Foundation/NSClassDescription.h index afce7c3d0..aa0a73317 100644 --- a/Headers/Foundation/NSClassDescription.h +++ b/Headers/Foundation/NSClassDescription.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef STRICT_OPENSTEP @class NSArray; @@ -68,5 +72,9 @@ GS_EXPORT NSString* const NSClassDescriptionNeededForClassNotification; #endif +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSCoder.h b/Headers/Foundation/NSCoder.h index a950838d2..79861e137 100644 --- a/Headers/Foundation/NSCoder.h +++ b/Headers/Foundation/NSCoder.h @@ -29,6 +29,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableData, NSData, NSString; /** @@ -389,4 +393,8 @@ #endif /* NO_GNUSTEP */ +#if defined(__cplusplus) +} +#endif + #endif /* __NSCoder_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSComparisonPredicate.h b/Headers/Foundation/NSComparisonPredicate.h index ec9a88d90..a33a04496 100644 --- a/Headers/Foundation/NSComparisonPredicate.h +++ b/Headers/Foundation/NSComparisonPredicate.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + typedef enum _NSComparisonPredicateModifier { NSDirectPredicateModifier=0, @@ -94,4 +98,8 @@ typedef enum _NSPredicateOperatorType @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSCompoundPredicate.h b/Headers/Foundation/NSCompoundPredicate.h index 60d95bfe4..05b90fab4 100644 --- a/Headers/Foundation/NSCompoundPredicate.h +++ b/Headers/Foundation/NSCompoundPredicate.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + typedef enum _NSCompoundPredicateType { NSNotPredicateType = 0, @@ -46,5 +50,10 @@ typedef enum _NSCompoundPredicateType - (NSArray *) subpredicates; @end + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSConnection.h b/Headers/Foundation/NSConnection.h index fb3756d91..ff91b0576 100644 --- a/Headers/Foundation/NSConnection.h +++ b/Headers/Foundation/NSConnection.h @@ -33,6 +33,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSDistantObject; @class NSPort; @class NSPortNameServer; @@ -295,4 +299,8 @@ GS_EXPORT NSString * const NSConnectionDidInitializeNotification; /* OPENSTEP */ */ GS_EXPORT NSString * const NSFailedAuthenticationException; /* MacOS-X */ +#if defined(__cplusplus) +} +#endif + #endif /* __NSConnection_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSData.h b/Headers/Foundation/NSData.h index 6324b8ac6..5b7bda44d 100644 --- a/Headers/Foundation/NSData.h +++ b/Headers/Foundation/NSData.h @@ -29,6 +29,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef STRICT_OPENSTEP @class NSURL; #endif @@ -344,10 +348,8 @@ @end #endif -/* - Local Variables: - mode: ObjC - End: - */ +#if defined(__cplusplus) +} +#endif #endif /* __NSData_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSDate.h b/Headers/Foundation/NSDate.h index 353d4a3a5..929b329da 100644 --- a/Headers/Foundation/NSDate.h +++ b/Headers/Foundation/NSDate.h @@ -24,6 +24,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /** * Time interval difference between two dates, in seconds. */ @@ -111,4 +115,8 @@ GS_EXPORT const NSTimeInterval NSTimeIntervalSince1970; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSDate_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSDateFormatter.h b/Headers/Foundation/NSDateFormatter.h index 7544af3c5..eade6b319 100644 --- a/Headers/Foundation/NSDateFormatter.h +++ b/Headers/Foundation/NSDateFormatter.h @@ -30,6 +30,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /** *

Class for generating text representations of [NSDate]s and * [NSCalendarDate]s, and for converting strings into instances of these @@ -135,4 +139,8 @@ #endif +#if defined(__cplusplus) +} +#endif + #endif /* _NSDateFormatter_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSDebug.h b/Headers/Foundation/NSDebug.h index f69b6bb8a..6c0e88005 100644 --- a/Headers/Foundation/NSDebug.h +++ b/Headers/Foundation/NSDebug.h @@ -31,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /* * Functions for debugging object allocation/deallocation * @@ -462,4 +466,8 @@ GS_EXPORT void *NSReturnAddress(int offset); */ GS_EXPORT unsigned NSCountFrames(void); +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSDecimal.h b/Headers/Foundation/NSDecimal.h index 216ea4138..0bc13a09e 100644 --- a/Headers/Foundation/NSDecimal.h +++ b/Headers/Foundation/NSDecimal.h @@ -36,6 +36,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /** * Enumerated type for specifying decimal rounding behavior. Can be one of * NSRoundDown (always round down), NSRoundUp @@ -245,6 +249,10 @@ GS_EXPORT void NSDecimalFromString(NSDecimal *result, NSString *numberValue, NSDictionary *locale); +#if defined(__cplusplus) +} +#endif + #endif #endif diff --git a/Headers/Foundation/NSDecimalNumber.h b/Headers/Foundation/NSDecimalNumber.h index c447e2cb3..eca4def1f 100644 --- a/Headers/Foundation/NSDecimalNumber.h +++ b/Headers/Foundation/NSDecimalNumber.h @@ -32,6 +32,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSDecimalNumber; /** @@ -404,5 +408,9 @@ - (NSDecimal) decimalValue; @end +#if defined(__cplusplus) +} +#endif + #endif #endif diff --git a/Headers/Foundation/NSDictionary.h b/Headers/Foundation/NSDictionary.h index fc6f35d0e..1779c74b2 100644 --- a/Headers/Foundation/NSDictionary.h +++ b/Headers/Foundation/NSDictionary.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray, NSString, NSEnumerator, NSURL; @interface NSDictionary : NSObject @@ -98,4 +102,8 @@ #endif @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSDistantObject.h b/Headers/Foundation/NSDistantObject.h index 5dcbab3ed..a3a148a91 100644 --- a/Headers/Foundation/NSDistantObject.h +++ b/Headers/Foundation/NSDistantObject.h @@ -28,6 +28,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSConnection; @interface NSDistantObject : NSProxy @@ -60,4 +64,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSDistantObject_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSDistributedLock.h b/Headers/Foundation/NSDistributedLock.h index 584a99f54..7c3a3faa8 100644 --- a/Headers/Foundation/NSDistributedLock.h +++ b/Headers/Foundation/NSDistributedLock.h @@ -29,6 +29,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSDistributedLock : NSObject { NSString *_lockPath; @@ -45,4 +49,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSDistributedLock_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSDistributedNotificationCenter.h b/Headers/Foundation/NSDistributedNotificationCenter.h index 13aed39db..b9973787e 100644 --- a/Headers/Foundation/NSDistributedNotificationCenter.h +++ b/Headers/Foundation/NSDistributedNotificationCenter.h @@ -31,6 +31,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /** * Enumeration of possible values for specifying how @@ -109,6 +113,10 @@ GS_EXPORT NSString* const GSNetworkNotificationCenterType; @end +#if defined(__cplusplus) +} +#endif + #endif #endif diff --git a/Headers/Foundation/NSEnumerator.h b/Headers/Foundation/NSEnumerator.h index 938969091..a4ee43f70 100644 --- a/Headers/Foundation/NSEnumerator.h +++ b/Headers/Foundation/NSEnumerator.h @@ -29,9 +29,17 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSEnumerator : NSObject - (NSArray *) allObjects; - (id) nextObject; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSEnumerator_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSError.h b/Headers/Foundation/NSError.h index dff4860e7..d8b558138 100644 --- a/Headers/Foundation/NSError.h +++ b/Headers/Foundation/NSError.h @@ -31,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSDictionary, NSString; /** @@ -116,5 +120,9 @@ GS_EXPORT NSString* const NSPOSIXErrorDomain; - (NSDictionary*) userInfo; @end +#if defined(__cplusplus) +} +#endif + #endif /* STRICT_OPENSTEP */ #endif /* __NSError_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSException.h b/Headers/Foundation/NSException.h index e366754fb..d2cba3c2a 100644 --- a/Headers/Foundation/NSException.h +++ b/Headers/Foundation/NSException.h @@ -35,6 +35,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSDictionary; /** @@ -444,4 +448,8 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler ); #define NSCParameterAssert(condition) \ _NSCAssertArgs((condition), @"Invalid parameter not satisfying: %s", #condition) +#if defined(__cplusplus) +} +#endif + #endif /* __NSException_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSExpression.h b/Headers/Foundation/NSExpression.h index f8ce0ef1f..c6f148783 100644 --- a/Headers/Foundation/NSExpression.h +++ b/Headers/Foundation/NSExpression.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableDictionary; typedef enum _NSExpressionType @@ -59,5 +63,10 @@ typedef enum _NSExpressionType - (NSString *) variable; @end + +#if defined(__cplusplus) +} +#endif + #endif /* __NSExpression_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSFileHandle.h b/Headers/Foundation/NSFileHandle.h index b32897437..68517b667 100644 --- a/Headers/Foundation/NSFileHandle.h +++ b/Headers/Foundation/NSFileHandle.h @@ -32,6 +32,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSFileHandle : NSObject // Allocating and Initializing a FileHandle Object @@ -237,4 +241,8 @@ GS_EXPORT NSString * const GSFileHandleWriteCompletionNotification; GS_EXPORT NSString * const GSFileHandleNotificationError; #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSFileHandle_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSFileManager.h b/Headers/Foundation/NSFileManager.h index 86ffb3534..a5b67ee71 100644 --- a/Headers/Foundation/NSFileManager.h +++ b/Headers/Foundation/NSFileManager.h @@ -21,7 +21,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. @@ -174,6 +175,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSNumber; @class NSString; @class NSData; @@ -459,5 +464,9 @@ GS_EXPORT NSString* const NSFileSystemFreeNodes; - (unsigned long) fileSystemFileNumber; @end +#if defined(__cplusplus) +} +#endif + #endif #endif /* __NSFileManager_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSFormatter.h b/Headers/Foundation/NSFormatter.h index 55fff494b..f162a0b30 100644 --- a/Headers/Foundation/NSFormatter.h +++ b/Headers/Foundation/NSFormatter.h @@ -30,6 +30,10 @@ #ifndef STRICT_OPENSTEP +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString, NSAttributedString, NSDictionary; /** @@ -117,6 +121,10 @@ - (NSString*) stringForObjectValue: (id)anObject; @end +#if defined(__cplusplus) +} +#endif + #endif #endif diff --git a/Headers/Foundation/NSGeometry.h b/Headers/Foundation/NSGeometry.h index d76ee749b..db525a884 100644 --- a/Headers/Foundation/NSGeometry.h +++ b/Headers/Foundation/NSGeometry.h @@ -31,6 +31,10 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + /**** Type, Constant, and Macro Definitions **********************************/ #ifndef MAX @@ -561,4 +565,9 @@ GS_EXPORT NSRect NSRectFromString(NSString* string); #undef GS_DEFINED_MIN #undef MIN #endif + +#if defined(__cplusplus) +} +#endif + #endif /* __NSGeometry_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSHTTPCookie.h b/Headers/Foundation/NSHTTPCookie.h index 2ecf850ec..4c1d7ab78 100644 --- a/Headers/Foundation/NSHTTPCookie.h +++ b/Headers/Foundation/NSHTTPCookie.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSArray; @@ -243,4 +247,9 @@ extern NSString * const NSHTTPCookieVersion; /** Obtain cookie version */ @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSHTTPCookieStorage.h b/Headers/Foundation/NSHTTPCookieStorage.h index 6aa87a5d8..7fc21cb0a 100644 --- a/Headers/Foundation/NSHTTPCookieStorage.h +++ b/Headers/Foundation/NSHTTPCookieStorage.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSArray; @@ -115,4 +119,9 @@ extern NSString * const NSHTTPCookieManagerCookiesChangedNotification; @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSHashTable.h b/Headers/Foundation/NSHashTable.h index c0e08e924..40c7bb7b1 100644 --- a/Headers/Foundation/NSHashTable.h +++ b/Headers/Foundation/NSHashTable.h @@ -34,6 +34,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /**** Type, Constant, and Macro Definitions **********************************/ /** @@ -138,4 +142,8 @@ NSHashRemove(NSHashTable *table, const void *element); GS_EXPORT NSString * NSStringFromHashTable(NSHashTable *table); +#if defined(__cplusplus) +} +#endif + #endif /* __NSHashTable_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSHost.h b/Headers/Foundation/NSHost.h index 7520a7570..d27615911 100644 --- a/Headers/Foundation/NSHost.h +++ b/Headers/Foundation/NSHost.h @@ -26,6 +26,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString, NSArray, NSSet; /** @@ -118,5 +122,9 @@ + (NSHost*) localHost; /* All local IP addresses */ @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSIndexPath.h b/Headers/Foundation/NSIndexPath.h index 54bf03580..fa7d65063 100644 --- a/Headers/Foundation/NSIndexPath.h +++ b/Headers/Foundation/NSIndexPath.h @@ -30,6 +30,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100400,GS_API_LATEST) && GS_API_VERSION(010200,GS_API_LATEST) /** @@ -105,4 +109,8 @@ #endif +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSIndexSet.h b/Headers/Foundation/NSIndexSet.h index f1c84bc5b..d75773c7f 100644 --- a/Headers/Foundation/NSIndexSet.h +++ b/Headers/Foundation/NSIndexSet.h @@ -33,6 +33,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /** * Instances of this class are collections of unsigned integers in the * range 0 to NSNotFound-1.
@@ -212,5 +216,9 @@ @end +#if defined(__cplusplus) +} +#endif + #endif #endif diff --git a/Headers/Foundation/NSInvocation.h b/Headers/Foundation/NSInvocation.h index db8df16f6..3a7af7df9 100644 --- a/Headers/Foundation/NSInvocation.h +++ b/Headers/Foundation/NSInvocation.h @@ -28,6 +28,9 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif @interface NSInvocation : NSObject { @@ -145,5 +148,8 @@ [NSInvocation _returnInvocationAndDestroyProxy: __proxy]; \ }) -#endif /* __NSInvocation_h_GNUSTEP_BASE_INCLUDE */ +#if defined(__cplusplus) +} +#endif +#endif /* __NSInvocation_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSKeyValueCoding.h b/Headers/Foundation/NSKeyValueCoding.h index 4e7052e6e..b5ae9d568 100644 --- a/Headers/Foundation/NSKeyValueCoding.h +++ b/Headers/Foundation/NSKeyValueCoding.h @@ -28,6 +28,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSMutableArray; @class NSDictionary; @@ -354,5 +358,10 @@ GS_EXPORT NSString* const NSUndefinedKeyException; @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSKeyValueObserving.h b/Headers/Foundation/NSKeyValueObserving.h index 4d0db707e..1a07e290f 100644 --- a/Headers/Foundation/NSKeyValueObserving.h +++ b/Headers/Foundation/NSKeyValueObserving.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100300,GS_API_LATEST) && GS_API_VERSION(010200,GS_API_LATEST) @class NSArray; @@ -221,5 +225,10 @@ triggerChangeNotificationsForDependentKey: (NSString*)dependentKey; @end #endif + +#if defined(__cplusplus) +} +#endif + #endif /* __NSKeyValueObserving_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSKeyedArchiver.h b/Headers/Foundation/NSKeyedArchiver.h index 31a956217..55fe982a2 100644 --- a/Headers/Foundation/NSKeyedArchiver.h +++ b/Headers/Foundation/NSKeyedArchiver.h @@ -31,6 +31,10 @@ #ifndef STRICT_OPENSTEP +#if defined(__cplusplus) +extern "C" { +#endif + #include #include #include @@ -560,5 +564,9 @@ willReplaceObject: (id)anObject - (NSSize) decodeSizeForKey: (NSString*)aKey; @end +#if defined(__cplusplus) +} +#endif + #endif /* STRICT_OPENSTEP */ #endif /* __NSKeyedArchiver_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSLock.h b/Headers/Foundation/NSLock.h index 674723cc7..920561493 100644 --- a/Headers/Foundation/NSLock.h +++ b/Headers/Foundation/NSLock.h @@ -25,7 +25,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #ifndef _GNUstep_H_NSLock @@ -33,6 +34,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /** * Protocol defining lock and unlock operations. */ @@ -286,4 +291,8 @@ #endif /* NO_GNUSTEP */ +#if defined(__cplusplus) +} +#endif + #endif /* _GNUstep_H_NSLock*/ diff --git a/Headers/Foundation/NSMapTable.h b/Headers/Foundation/NSMapTable.h index 4a6816755..5ca10cd55 100644 --- a/Headers/Foundation/NSMapTable.h +++ b/Headers/Foundation/NSMapTable.h @@ -33,6 +33,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /**** Type, Constant, and Macro Definitions **********************************/ /** @@ -205,4 +209,8 @@ NSMapRemove(NSMapTable *table, const void *key); GS_EXPORT NSString *NSStringFromMapTable (NSMapTable *table); +#if defined(__cplusplus) +} +#endif + #endif /* __NSMapTable_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSMethodSignature.h b/Headers/Foundation/NSMethodSignature.h index 540b67249..0239d88f8 100644 --- a/Headers/Foundation/NSMethodSignature.h +++ b/Headers/Foundation/NSMethodSignature.h @@ -29,6 +29,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef STRICT_MACOS_X /** *

Info about layout of arguments. @@ -168,4 +172,8 @@ typedef struct { @end #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSMethodSignature_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSNotification.h b/Headers/Foundation/NSNotification.h index 736b934c0..cc26271ca 100644 --- a/Headers/Foundation/NSNotification.h +++ b/Headers/Foundation/NSNotification.h @@ -32,6 +32,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString; @class NSDictionary; @class NSLock; @@ -84,16 +88,8 @@ @end -#ifndef NO_GNUSTEP - -@interface NSNotificationCenter (GNUstep) -/** - * You can disable locking in a multi-threaded program if you KNOW that only - * one thread will ever use the notification center.
- * DEPRECATED - */ -- (BOOL) setLockingDisabled: (BOOL)flag; -@end +#if defined(__cplusplus) +} #endif #endif /*__NSNotification_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSNotificationQueue.h b/Headers/Foundation/NSNotificationQueue.h index 457eba1fc..2fd06a625 100644 --- a/Headers/Foundation/NSNotificationQueue.h +++ b/Headers/Foundation/NSNotificationQueue.h @@ -49,6 +49,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableArray; /* @@ -126,4 +130,8 @@ struct _NSNotificationQueueList; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSNotificationQueue_h__ */ diff --git a/Headers/Foundation/NSNull.h b/Headers/Foundation/NSNull.h index 5d62f1f3c..9edfab1e3 100644 --- a/Headers/Foundation/NSNull.h +++ b/Headers/Foundation/NSNull.h @@ -31,10 +31,18 @@ #ifndef NO_MACOS_X #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSNull : NSObject + (NSNull*) null; @end +#if defined(__cplusplus) +} +#endif + #endif #endif /* __NSNull_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSNumberFormatter.h b/Headers/Foundation/NSNumberFormatter.h index 3e6a525e8..103fbb5cb 100644 --- a/Headers/Foundation/NSNumberFormatter.h +++ b/Headers/Foundation/NSNumberFormatter.h @@ -32,6 +32,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString, NSAttributedString, NSDictionary; /** @@ -295,5 +299,9 @@ @end +#if defined(__cplusplus) +} +#endif + #endif #endif diff --git a/Headers/Foundation/NSObjCRuntime.h b/Headers/Foundation/NSObjCRuntime.h index 31800cb78..8105c7008 100644 --- a/Headers/Foundation/NSObjCRuntime.h +++ b/Headers/Foundation/NSObjCRuntime.h @@ -31,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + GS_EXPORT NSString *NSStringFromSelector(SEL aSelector); GS_EXPORT SEL NSSelectorFromString(NSString *aSelectorName); GS_EXPORT Class NSClassFromString(NSString *aClassName); @@ -65,4 +69,8 @@ GS_EXPORT void NSLogv (NSString *format, va_list args); #define nil 0 #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSObject.h b/Headers/Foundation/NSObject.h index 9967ccc29..803fe3998 100644 --- a/Headers/Foundation/NSObject.h +++ b/Headers/Foundation/NSObject.h @@ -28,6 +28,10 @@ #ifndef __NSObject_h_GNUSTEP_BASE_INCLUDE #define __NSObject_h_GNUSTEP_BASE_INCLUDE +#if defined(__cplusplus) +extern "C" { +#endif + /* * Check consistency of definitions for system compatibility. */ @@ -719,4 +723,8 @@ if (__value != __object) \ #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSObject_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSPathUtilities.h b/Headers/Foundation/NSPathUtilities.h index 9bcd0ce1d..1bbecc484 100644 --- a/Headers/Foundation/NSPathUtilities.h +++ b/Headers/Foundation/NSPathUtilities.h @@ -29,6 +29,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef NO_GNUSTEP @class NSDictionary; @class NSMutableDictionary; @@ -174,4 +178,8 @@ GS_EXPORT NSString *NSTemporaryDirectory(void); GS_EXPORT NSString *NSOpenStepRootDirectory(void); #endif /* !STRICT_OPENSTEP */ +#if defined(__cplusplus) +} +#endif + #endif /* __NSPathUtilities_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSPort.h b/Headers/Foundation/NSPort.h index e1c7ccecc..4771ca714 100644 --- a/Headers/Foundation/NSPort.h +++ b/Headers/Foundation/NSPort.h @@ -40,6 +40,10 @@ #define SOCKET int #endif +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableArray; @class NSConnection; @class NSDate; @@ -312,6 +316,10 @@ typedef SOCKET NSSocketNativeHandle; #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSPort_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSPortCoder.h b/Headers/Foundation/NSPortCoder.h index f450ca6fd..a4cd53dce 100644 --- a/Headers/Foundation/NSPortCoder.h +++ b/Headers/Foundation/NSPortCoder.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSMutableArray; @class NSMutableDictionary; @class NSConnection; @@ -173,4 +177,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSPortCoder_h */ diff --git a/Headers/Foundation/NSPortMessage.h b/Headers/Foundation/NSPortMessage.h index 59648156e..2eb649895 100644 --- a/Headers/Foundation/NSPortMessage.h +++ b/Headers/Foundation/NSPortMessage.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /** *

The data transported for distributed objects communications is sent over * the network encapsulated by NSPortMessage objects, which consist of two @@ -100,5 +104,9 @@ - (unsigned) msgid; @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSPortNameServer.h b/Headers/Foundation/NSPortNameServer.h index ac4d8d55c..2417a346a 100644 --- a/Headers/Foundation/NSPortNameServer.h +++ b/Headers/Foundation/NSPortNameServer.h @@ -35,6 +35,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSPort, NSString, NSMutableArray; @interface NSPortNameServer : NSObject @@ -67,5 +71,9 @@ + (id) sharedInstance; @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSPredicate.h b/Headers/Foundation/NSPredicate.h index 288ae2367..4f70841ef 100644 --- a/Headers/Foundation/NSPredicate.h +++ b/Headers/Foundation/NSPredicate.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSPredicate : NSObject + (NSPredicate *) predicateWithFormat: (NSString *)format, ...; @@ -47,4 +51,8 @@ - (NSArray *) filteredArrayUsingPredicate: (NSPredicate *)predicate; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSPredicate_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSProcessInfo.h b/Headers/Foundation/NSProcessInfo.h index 5ddcf8abd..c9c952ff3 100644 --- a/Headers/Foundation/NSProcessInfo.h +++ b/Headers/Foundation/NSProcessInfo.h @@ -29,6 +29,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSMutableArray; @class NSDictionary; @@ -97,4 +101,8 @@ GS_EXPORT BOOL GSDebugSet(NSString *level); #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSProcessInfo_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSPropertyList.h b/Headers/Foundation/NSPropertyList.h index e5ced15bd..27c8acb77 100644 --- a/Headers/Foundation/NSPropertyList.h +++ b/Headers/Foundation/NSPropertyList.h @@ -28,10 +28,14 @@ #ifndef __NSPropertyList_h_GNUSTEP_BASE_INCLUDE #define __NSPropertyList_h_GNUSTEP_BASE_INCLUDE -#ifndef STRICT_OPENSTEP - #include +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef STRICT_OPENSTEP + @class NSData, NSString; /** @@ -247,4 +251,9 @@ typedef enum { @end #endif /* STRICT_OPENSTEP */ + +#if defined(__cplusplus) +} +#endif + #endif /* __NSPropertyList_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSProtocolChecker.h b/Headers/Foundation/NSProtocolChecker.h index 1adcb17f6..8ab632cbb 100644 --- a/Headers/Foundation/NSProtocolChecker.h +++ b/Headers/Foundation/NSProtocolChecker.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class Protocol; @interface NSProtocolChecker : NSProxy @@ -54,4 +58,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSProxy.h b/Headers/Foundation/NSProxy.h index dddd0b2c6..199494d7e 100644 --- a/Headers/Foundation/NSProxy.h +++ b/Headers/Foundation/NSProxy.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSProxy { @public @@ -75,4 +79,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSProxy_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSRange.h b/Headers/Foundation/NSRange.h index a31b83e6b..819fabcfb 100644 --- a/Headers/Foundation/NSRange.h +++ b/Headers/Foundation/NSRange.h @@ -28,6 +28,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSException; @class NXConstantString; @@ -242,4 +246,8 @@ if (INDEX >= OVER) \ GSNameFromSelector(_cmd), INDEX] #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSRange_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSRunLoop.h b/Headers/Foundation/NSRunLoop.h index 37219236f..0be4811e0 100644 --- a/Headers/Foundation/NSRunLoop.h +++ b/Headers/Foundation/NSRunLoop.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSTimer, NSDate, NSPort; /** @@ -145,4 +149,8 @@ typedef enum { all: (BOOL)removeAll; @end +#if defined(__cplusplus) +} +#endif + #endif /*__NSRunLoop_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSScanner.h b/Headers/Foundation/NSScanner.h index 2c2e2cd77..c52a1d10d 100644 --- a/Headers/Foundation/NSScanner.h +++ b/Headers/Foundation/NSScanner.h @@ -29,6 +29,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /* * NSScanner class */ @@ -96,4 +100,8 @@ #endif @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSScanner_h_GNUSTEP_INCLUDE */ diff --git a/Headers/Foundation/NSSerialization.h b/Headers/Foundation/NSSerialization.h index c2ca8e379..c31e8cb7c 100644 --- a/Headers/Foundation/NSSerialization.h +++ b/Headers/Foundation/NSSerialization.h @@ -29,6 +29,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSData, NSMutableData; /** @@ -187,4 +191,8 @@ #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSSerialization_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSSet.h b/Headers/Foundation/NSSet.h index fc45deab6..38d4f755d 100644 --- a/Headers/Foundation/NSSet.h +++ b/Headers/Foundation/NSSet.h @@ -31,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray, NSString, NSEnumerator, NSDictionary; @interface NSSet : NSObject @@ -175,4 +179,8 @@ id GSUSet(id anObject, unsigned count); #endif /* NO_GNUSTEP */ +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSSortDescriptor.h b/Headers/Foundation/NSSortDescriptor.h index fafe9009f..dfe38f7e4 100644 --- a/Headers/Foundation/NSSortDescriptor.h +++ b/Headers/Foundation/NSSortDescriptor.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString; @interface NSSortDescriptor : NSObject @@ -66,4 +70,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSSortDescriptor_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSStream.h b/Headers/Foundation/NSStream.h index d24b17dce..3d4035711 100644 --- a/Headers/Foundation/NSStream.h +++ b/Headers/Foundation/NSStream.h @@ -26,6 +26,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100400,GS_API_LATEST) && GS_API_VERSION(010200,GS_API_LATEST) typedef enum { @@ -333,4 +337,8 @@ GS_EXPORT NSString * const NSStreamSOCKSProxyVersionKey; #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSStream_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSString.h b/Headers/Foundation/NSString.h index 57613a888..ad8215f03 100644 --- a/Headers/Foundation/NSString.h +++ b/Headers/Foundation/NSString.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + /** * Type for representing unicode characters. (16-bit) */ @@ -795,4 +799,8 @@ extern struct objc_class _NSConstantStringClassReference; #endif /* NO_GNUSTEP */ +#if defined(__cplusplus) +} +#endif + #endif /* __NSString_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSTask.h b/Headers/Foundation/NSTask.h index 74b5228d2..645c98fd7 100644 --- a/Headers/Foundation/NSTask.h +++ b/Headers/Foundation/NSTask.h @@ -31,6 +31,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSTask : NSObject { NSString *_currentDirectoryPath; @@ -107,4 +111,8 @@ */ GS_EXPORT NSString* const NSTaskDidTerminateNotification; +#if defined(__cplusplus) +} +#endif + #endif /* __NSTask_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSThread.h b/Headers/Foundation/NSThread.h index 7c6268232..44681fce1 100644 --- a/Headers/Foundation/NSThread.h +++ b/Headers/Foundation/NSThread.h @@ -31,6 +31,10 @@ #include #include // for struct autorelease_thread_vars +#if defined(__cplusplus) +extern "C" { +#endif + @interface NSThread : NSObject { id _target; @@ -144,4 +148,8 @@ GS_EXPORT NSThread *GSCurrentThread(void); GS_EXPORT NSMutableDictionary *GSCurrentThreadDictionary(void); #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSThread_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSTimeZone.h b/Headers/Foundation/NSTimeZone.h index 778b82ae8..c2fcadf4f 100644 --- a/Headers/Foundation/NSTimeZone.h +++ b/Headers/Foundation/NSTimeZone.h @@ -24,6 +24,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSDate; @class NSDictionary; @@ -92,5 +96,9 @@ @end #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSTimeZone_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSTimer.h b/Headers/Foundation/NSTimer.h index 372faecfa..3ef1f72a5 100644 --- a/Headers/Foundation/NSTimer.h +++ b/Headers/Foundation/NSTimer.h @@ -30,6 +30,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + /* * NB. NSRunLoop is optimised using a hack that knows about the * class layout for the fire date and invialidation flag in NSTimer. @@ -86,4 +90,8 @@ @end +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURL.h b/Headers/Foundation/NSURL.h index e18f7bffb..eaa644502 100644 --- a/Headers/Foundation/NSURL.h +++ b/Headers/Foundation/NSURL.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef STRICT_OPENSTEP @class NSNumber; @@ -114,4 +118,8 @@ GS_EXPORT NSString* const NSURLFileScheme; #endif +#if defined(__cplusplus) +} +#endif + #endif //_NSUrl_h__ diff --git a/Headers/Foundation/NSURLAuthenticationChallenge.h b/Headers/Foundation/NSURLAuthenticationChallenge.h index 13630cd4f..a8d9d5ee9 100644 --- a/Headers/Foundation/NSURLAuthenticationChallenge.h +++ b/Headers/Foundation/NSURLAuthenticationChallenge.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSError; @@ -142,4 +146,9 @@ @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLCache.h b/Headers/Foundation/NSURLCache.h index be021900e..7be6cb21d 100644 --- a/Headers/Foundation/NSURLCache.h +++ b/Headers/Foundation/NSURLCache.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSData; @@ -190,4 +194,9 @@ typedef enum @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLConnection.h b/Headers/Foundation/NSURLConnection.h index 5e8fcc8f6..ab726828d 100644 --- a/Headers/Foundation/NSURLConnection.h +++ b/Headers/Foundation/NSURLConnection.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSCachedURLResponse; @@ -225,4 +229,9 @@ @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLCredential.h b/Headers/Foundation/NSURLCredential.h index f6d2c849c..9b4c9fa00 100644 --- a/Headers/Foundation/NSURLCredential.h +++ b/Headers/Foundation/NSURLCredential.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSString; @@ -102,4 +106,9 @@ typedef enum { @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLCredentialStorage.h b/Headers/Foundation/NSURLCredentialStorage.h index 142568f53..6e81f2b16 100644 --- a/Headers/Foundation/NSURLCredentialStorage.h +++ b/Headers/Foundation/NSURLCredentialStorage.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSDictionary; @@ -100,4 +104,9 @@ extern NSString *const NSURLCredentialStorageChangedNotification; @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLDownload.h b/Headers/Foundation/NSURLDownload.h index f60b1abaa..fbed10d9b 100644 --- a/Headers/Foundation/NSURLDownload.h +++ b/Headers/Foundation/NSURLDownload.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSData; @@ -203,4 +207,9 @@ @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLError.h b/Headers/Foundation/NSURLError.h index 9f3c28899..18780e88c 100644 --- a/Headers/Foundation/NSURLError.h +++ b/Headers/Foundation/NSURLError.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSString; @@ -85,4 +89,9 @@ enum }; #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLHandle.h b/Headers/Foundation/NSURLHandle.h index 9938a4f74..5125c259c 100644 --- a/Headers/Foundation/NSURLHandle.h +++ b/Headers/Foundation/NSURLHandle.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #ifndef STRICT_OPENSTEP @class NSData; @@ -212,4 +216,8 @@ typedef enum #endif +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLProtectionSpace.h b/Headers/Foundation/NSURLProtectionSpace.h index 347b25fb6..22325b5a1 100644 --- a/Headers/Foundation/NSURLProtectionSpace.h +++ b/Headers/Foundation/NSURLProtectionSpace.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSString; @@ -126,4 +130,9 @@ authenticationMethod: (NSString *)authenticationMethod; @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLProtocol.h b/Headers/Foundation/NSURLProtocol.h index 8a8c2756b..3dc619c85 100644 --- a/Headers/Foundation/NSURLProtocol.h +++ b/Headers/Foundation/NSURLProtocol.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) #include @@ -219,4 +223,9 @@ @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLRequest.h b/Headers/Foundation/NSURLRequest.h index e2addf86b..03b4a2bd7 100644 --- a/Headers/Foundation/NSURLRequest.h +++ b/Headers/Foundation/NSURLRequest.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @class NSData; @@ -272,4 +276,9 @@ typedef enum @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSURLResponse.h b/Headers/Foundation/NSURLResponse.h index 43fd161f4..8fc000a8e 100644 --- a/Headers/Foundation/NSURLResponse.h +++ b/Headers/Foundation/NSURLResponse.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION(011300,GS_API_LATEST) @@ -117,4 +121,9 @@ @end #endif + +#if defined(__cplusplus) +} +#endif + #endif diff --git a/Headers/Foundation/NSUndoManager.h b/Headers/Foundation/NSUndoManager.h index 1e969aa7f..d2ee333c4 100644 --- a/Headers/Foundation/NSUndoManager.h +++ b/Headers/Foundation/NSUndoManager.h @@ -26,6 +26,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSString; @class NSMutableArray; @@ -128,4 +132,8 @@ GS_EXPORT NSString* const NSUndoManagerWillUndoChangeNotification; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSUndoManager_h_OBJECTS_INCLUDE */ diff --git a/Headers/Foundation/NSUserDefaults.h b/Headers/Foundation/NSUserDefaults.h index f5a8e8174..fb634c23e 100644 --- a/Headers/Foundation/NSUserDefaults.h +++ b/Headers/Foundation/NSUserDefaults.h @@ -29,6 +29,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSArray; @class NSMutableArray; @class NSDictionary; @@ -287,4 +291,8 @@ GS_EXPORT NSString* const NSLocale; - (void) registerDefaults: (NSDictionary*)newVals; @end +#if defined(__cplusplus) +} +#endif + #endif /* __NSUserDefaults_h_OBJECTS_INCLUDE */ diff --git a/Headers/Foundation/NSValue.h b/Headers/Foundation/NSValue.h index 350cadb0b..e54db3204 100644 --- a/Headers/Foundation/NSValue.h +++ b/Headers/Foundation/NSValue.h @@ -28,6 +28,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSString; /** @@ -363,4 +367,8 @@ GSNumberInfo *GSNumberInfoFromObject(NSNumber *o); unsigned GSSmallHash(int n); #endif +#if defined(__cplusplus) +} +#endif + #endif /* __NSValue_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/Foundation/NSXMLParser.h b/Headers/Foundation/NSXMLParser.h index 582b2a14d..756d09667 100644 --- a/Headers/Foundation/NSXMLParser.h +++ b/Headers/Foundation/NSXMLParser.h @@ -31,6 +31,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + @class NSData, NSDictionary, NSError, NSString, NSURL; /** @@ -399,5 +403,9 @@ typedef enum { NSXMLParserDelegateAbortedParseError = 512 } NSXMLParserError; +#if defined(__cplusplus) +} +#endif + #endif /* STRICT_OPENSTEP */ #endif /* __NSXMLParser_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/Foundation/NSZone.h b/Headers/Foundation/NSZone.h index e3a9da929..9a4c7d5be 100644 --- a/Headers/Foundation/NSZone.h +++ b/Headers/Foundation/NSZone.h @@ -57,6 +57,10 @@ typedef struct _NSZone NSZone; @class NSString; +#if defined(__cplusplus) +extern "C" { +#endif + /** * NSZoneStats is the structure returned by the NSZoneStats() @@ -447,4 +451,8 @@ GS_EXPORT void NSDeallocateMemoryPages (void *ptr, unsigned bytes); GS_EXPORT void NSCopyMemoryPages (const void *src, void *dest, unsigned bytes); +#if defined(__cplusplus) +} +#endif + #endif /* not __NSZone_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Source/NSNotificationCenter.m b/Source/NSNotificationCenter.m index 63a9a870d..d3c9f0991 100644 --- a/Source/NSNotificationCenter.m +++ b/Source/NSNotificationCenter.m @@ -241,12 +241,10 @@ typedef struct NCTbl { GSIMapTable named; /* Getting named messages only. */ unsigned lockCount; /* Count recursive operations. */ GSLazyRecursiveLock *_lock; /* Lock out other threads. */ - BOOL lockingDisabled; - - Observation *freeList; - Observation **chunks; - unsigned numChunks; - GSIMapTable cache[CACHESIZE]; + Observation *freeList; + Observation **chunks; + unsigned numChunks; + GSIMapTable cache[CACHESIZE]; unsigned short chunkIndex; unsigned short cacheIndex; } NCTable; @@ -407,16 +405,14 @@ static NCTable *newNCTable(void) static inline void lockNCTable(NCTable* t) { - if (t->lockingDisabled == NO) - [t->_lock lock]; + [t->_lock lock]; t->lockCount++; } static inline void unlockNCTable(NCTable* t) { t->lockCount--; - if (t->lockingDisabled == NO) - [t->_lock unlock]; + [t->_lock unlock]; } static void obsFree(Observation *o) @@ -1142,32 +1138,3 @@ static NSNotificationCenter *default_center = nil; @end -@implementation NSNotificationCenter (GNUstep) - -- (BOOL) setLockingDisabled: (BOOL)flag -{ - BOOL old; - - GSOnceMLog(@"This method is deprecated"); - lockNCTable(TABLE); - if (self == default_center) - { - unlockNCTable(TABLE); - [NSException raise: NSInvalidArgumentException - format: @"Can't change locking of default center."]; - } - if (LOCKCOUNT > 1) - { - unlockNCTable(TABLE); - [NSException raise: NSInvalidArgumentException - format: @"Can't change locking during post."]; - } - - old = TABLE->lockingDisabled; - TABLE->lockingDisabled = flag; - unlockNCTable(TABLE); - return old; -} - -@end - From d36967203e69f491c0db435cf28a01e4ea132455 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 13 Sep 2006 15:53:58 +0000 Subject: [PATCH 014/266] try to cope with apple plists git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23489 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++ Source/Additions/GSXML.m | 67 +++++++++++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 826126f38..866c09d38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-13 Richard Frith-Macdonald + + * Source/Additions/GSXML.m: Add hack to recognize apple plist info + and use the GNUstep plist DTD instead if necessary. + 2006-09-13 Richard Frith-Macdonald * Headers/Foundation/NSTimeZone.h: diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 8c7fb9ab4..fd6d39d83 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -2407,12 +2407,17 @@ static NSString *endMarker = @"At end of incremental parse"; */ #define HANDLER ((GSSAXHandler*)(((xmlParserCtxtPtr)ctx)->_private)) +#ifdef GNUSTEP +static NSString *applePList + = @"file://localhost/System/Library/DTDs/PropertyList.dtd"; +#endif + static xmlParserInputPtr loadEntityFunction(void *ctx, const unsigned char *eid, const unsigned char *url) { extern xmlParserInputPtr xmlNewInputFromFile(); - NSString *file; + NSString *file = nil; xmlParserInputPtr ret = 0; NSString *entityId; NSString *location; @@ -2422,10 +2427,10 @@ loadEntityFunction(void *ctx, unsigned index; NSCAssert(ctx, @"No Context"); - if (eid == 0 || url == 0) + if (url == 0) return 0; - entityId = UTF8Str(eid); + entityId = (eid != 0) ? (id)UTF8Str(eid) : nil; location = UTF8Str(url); components = [location pathComponents]; local = [NSMutableString string]; @@ -2450,13 +2455,31 @@ loadEntityFunction(void *ctx, options: NSLiteralSearch range: NSMakeRange(0, [local length])]; - /* - * Now ask the SAXHandler callback for the name of a local file - */ - file = [HANDLER loadEntity: entityId at: location]; +#ifdef GNUSTEP + if ([location isEqual: applePList] == YES) + { + file = [location substringFromIndex: 6]; + if ([[NSFileManager defaultManager] fileExistsAtPath: file] == NO) + { + location = [NSBundle pathForLibraryResource: @"plist-0_9" + ofType: @"dtd" + inDirectory: @"DTDs"]; + entityId = @"-//GNUstep//DTD plist 0.9//EN"; + file = nil; + } + } +#endif + if (file == nil) { - file = [GSXMLParser loadEntity: entityId at: location]; + /* + * Now ask the SAXHandler callback for the name of a local file + */ + file = [HANDLER loadEntity: entityId at: location]; + if (file == nil) + { + file = [GSXMLParser loadEntity: entityId at: location]; + } } if (file == nil) @@ -2521,10 +2544,10 @@ loadEntityFunction(void *ctx, ofType: @"dtd" inDirectory: @"DTDs"]; #else - found = [[NSBundle bundleForClass:NSClassFromString(@"GSXMLNode")] - pathForResource:name - ofType:@"dtd" - inDirectory:@"DTDs"]; + found = [[NSBundle bundleForClass: NSClassFromString(@"GSXMLNode")] + pathForResource: name + ofType: @"dtd" + inDirectory: @"DTDs"]; #endif if (found == nil) { @@ -2550,6 +2573,26 @@ loadEntityFunction(void *ctx, ofType: @"" inDirectory: @"DTDs"]; } + if (file == nil) + { + NSURL *aURL; + + aURL = [NSURL URLWithString: location]; + if ([aURL isFileURL] == YES) + { + file = [aURL path]; + } + else + { + NSData *data = [aURL resourceDataUsingCache: NO]; + + if ([data length] > 0) + { + file = [@"/tmp" stringByAppendingPathComponent: local]; + [data writeToFile: local atomically: NO]; + } + } + } } } From b8ee8aa0c99c0021f159aaf171fcfeb1a919e7db Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 13 Sep 2006 21:33:38 +0000 Subject: [PATCH 015/266] avoid some possible signed/unsigned integer issues. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23491 72102866-910b-0410-8b05-ffd578937521 --- Source/NSCalendarDate.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index b3b7ec2d2..30eccd763 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -147,7 +147,7 @@ abbrev(NSTimeZone *tz, NSDate *d) } static inline unsigned int -lastDayOfGregorianMonth(int month, int year) +lastDayOfGregorianMonth(unsigned month, unsigned year) { switch (month) { @@ -165,12 +165,17 @@ lastDayOfGregorianMonth(int month, int year) } } -static inline int -absoluteGregorianDay(int day, int month, int year) +static inline unsigned +absoluteGregorianDay(unsigned day, unsigned month, unsigned year) { while (--month > 0) - day = day + lastDayOfGregorianMonth(month, year); - year--; + { + day = day + lastDayOfGregorianMonth(month, year); + } + if (year > 0) + { + year--; + } return (day // days this year + 365 * year // days in previous years ignoring leap days @@ -216,7 +221,7 @@ gregorianDateFromAbsolute(int abs, int *day, int *month, int *year) * since the reference date. */ static NSTimeInterval -GSTime(int day, int month, int year, int hour, int minute, int second, int mil) +GSTime(unsigned day, unsigned month, unsigned year, unsigned hour, unsigned minute, unsigned second, unsigned mil) { NSTimeInterval a; From fbc14b5695bd2d19a6579bbe4bbdcfcca97d022f Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 14 Sep 2006 04:45:10 +0000 Subject: [PATCH 016/266] Avoid compiler warning git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23496 72102866-910b-0410-8b05-ffd578937521 --- Source/GSStream.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GSStream.m b/Source/GSStream.m index cf84fec00..f25b6bb3b 100644 --- a/Source/GSStream.m +++ b/Source/GSStream.m @@ -1216,7 +1216,7 @@ static NSString * const GSSOCKSAckConn = @"GSSOCKSAckConn"; a = [NSString stringWithUTF8String: (const char*)rbuffer]; } - else if (rbuffer[3] == 4) + else { unsigned char buf[40]; int i = 4; From 39f7231d95e3911402bb3242e22282bad0e75088 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 14 Sep 2006 05:12:43 +0000 Subject: [PATCH 017/266] fix boundary error in last commit git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23498 72102866-910b-0410-8b05-ffd578937521 --- Source/NSCalendarDate.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index 30eccd763..25c57a3ba 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -168,9 +168,12 @@ lastDayOfGregorianMonth(unsigned month, unsigned year) static inline unsigned absoluteGregorianDay(unsigned day, unsigned month, unsigned year) { - while (--month > 0) + if (month > 1) { - day = day + lastDayOfGregorianMonth(month, year); + while (--month > 0) + { + day = day + lastDayOfGregorianMonth(month, year); + } } if (year > 0) { From 1fd53fc3220a9c42ae02a3b9f05b6219aa35208a Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 15 Sep 2006 05:58:05 +0000 Subject: [PATCH 018/266] fix boundary error git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23516 72102866-910b-0410-8b05-ffd578937521 --- Tools/objctidy.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/objctidy.m b/Tools/objctidy.m index 34f685225..97a5eabbd 100644 --- a/Tools/objctidy.m +++ b/Tools/objctidy.m @@ -287,7 +287,7 @@ main(int argc, char** argv, char **env) if ((pos < 80) && ([line length] + pos >= 80)) { - unsigned off = 80 - pos; + unsigned off = 79 - pos; /* * Look for a break in a method call/name From cde62cdb709f02123ece87fc3aeb1e2cf2a9df60 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 15 Sep 2006 06:02:41 +0000 Subject: [PATCH 019/266] handle common comments git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23517 72102866-910b-0410-8b05-ffd578937521 --- Tools/objctidy.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tools/objctidy.m b/Tools/objctidy.m index 97a5eabbd..652007016 100644 --- a/Tools/objctidy.m +++ b/Tools/objctidy.m @@ -137,8 +137,12 @@ main(int argc, char** argv, char **env) /* Now repair any excess space round operators. */ [line replaceString: @"+ +" withString: @"++"]; + [line replaceString: @"+ +" withString: @"++"]; [line replaceString: @"+ =" withString: @"+="]; [line replaceString: @"- -" withString: @"--"]; + [line replaceString: @"- -" withString: @"--"]; + [line replaceString: @"= =" withString: @"=="]; + [line replaceString: @"= =" withString: @"=="]; [line replaceString: @"- =" withString: @"-="]; [line replaceString: @"/ /" withString: @"//"]; [line replaceString: @"/ =" withString: @"/="]; @@ -160,6 +164,9 @@ main(int argc, char** argv, char **env) [line replaceString: @"- >" withString: @"->"]; [line replaceString: @"-> " withString: @"->"]; [line replaceString: @" ->" withString: @"->"]; + [line replaceString: @"/ *" withString: @"/*"]; + [line replaceString: @"* /" withString: @"*/"]; + [line replaceString: @"/ /" withString: @"//"]; [line replaceString: @" ," withString: @","]; [line replaceString: @"! " withString: @"!"]; From 01c104bb5d753d62aeca27df7135f358f7ccc56b Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 15 Sep 2006 06:08:50 +0000 Subject: [PATCH 020/266] better handling of closing braces git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23518 72102866-910b-0410-8b05-ffd578937521 --- Tools/objctidy.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/objctidy.m b/Tools/objctidy.m index 652007016..71c580e5a 100644 --- a/Tools/objctidy.m +++ b/Tools/objctidy.m @@ -262,7 +262,7 @@ main(int argc, char** argv, char **env) indentation += 4; } } - else if ([line isEqualToString: @"}"]) + else if ([line hasPrefix: @"}"]) { if (indentation >= 2) { From eeaff4c21544eb93bd2211fdd2b4bd1ba0d12f5a Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 15 Sep 2006 06:11:03 +0000 Subject: [PATCH 021/266] Append trailing newline git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23519 72102866-910b-0410-8b05-ffd578937521 --- Tools/objctidy.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/objctidy.m b/Tools/objctidy.m index 71c580e5a..ada365fc5 100644 --- a/Tools/objctidy.m +++ b/Tools/objctidy.m @@ -397,6 +397,7 @@ main(int argc, char** argv, char **env) RELEASE(line); } + [lines addObject: @""]; // Terminating newline file = [lines componentsJoinedByString: @"\n"]; RELEASE(lines); [file writeToFile: result atomically: NO]; From 2976d058cddde5fe7701413b495d1d4bcc82cc39 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Mon, 18 Sep 2006 20:31:04 +0000 Subject: [PATCH 022/266] Updated reading default gnustep config file from make system git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23550 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ configure | 16 +++++++++++++++- configure.ac | 17 ++++++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 866c09d38..e76452ae3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-09-18 Nicola Pero + + * configure.ac (GNUSTEP_MAKE_CONFIG): Get this config from + config-noarch.make (requires gnustep-make > 1.13.0). If failing, + fall back to taking it from $GNUSTEP_MAKEFILES/config.make as it + was done before (works with gnustep-make < 1.13.0 only though). + * configure: Regenerated. + 2006-09-13 Richard Frith-Macdonald * Source/Additions/GSXML.m: Add hack to recognize apple plist info diff --git a/configure b/configure index a2eced193..1d2451476 100755 --- a/configure +++ b/configure @@ -1988,7 +1988,21 @@ test -n "$target_alias" && { echo "$as_me:$LINENO: checking for GNUstep configuration file to use" >&5 echo $ECHO_N "checking for GNUstep configuration file to use... $ECHO_C" >&6; } GNUSTEP_CONFIG_FILE="" -GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` + +# This requires gnustep-make > 1.13.0 to work. For gnustep-make = +# 1.13.0 we would have to parse +# $GNUSTEP_MAKEFILES/$obj_dir/config.make, but $obj_dir is not defined +# yet at this stage in config, not sure if it's worth trying to make +# it work. For gnustep-make < 1.13.0 we would have to parse +# $GNUSTEP_MAKEFILES/config.make. +GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config-noarch.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` + +# So, for backwards compatiblity, we try the plain config.make too. +# This should work with gnustep-make < 1.13.0, and with 1.13.0 too if +# they haven't deleted the file. +if test "$GNUSTEP_MAKE_CONFIG" = ""; then + GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` +fi # Check whether --with-config-file was given. if test "${with_config_file+set}" = set; then diff --git a/configure.ac b/configure.ac index 0614e4304..473a55717 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,22 @@ AC_CANONICAL_TARGET([]) #--------------------------------------------------------------------- AC_MSG_CHECKING([for GNUstep configuration file to use]) GNUSTEP_CONFIG_FILE="" -GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` + +# This requires gnustep-make > 1.13.0 to work. For gnustep-make = +# 1.13.0 we would have to parse +# $GNUSTEP_MAKEFILES/$obj_dir/config.make, but $obj_dir is not defined +# yet at this stage in config, not sure if it's worth trying to make +# it work. For gnustep-make < 1.13.0 we would have to parse +# $GNUSTEP_MAKEFILES/config.make. +GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config-noarch.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` + +# So, for backwards compatiblity, we try the plain config.make too. +# This should work with gnustep-make < 1.13.0, and with 1.13.0 too if +# they haven't deleted the file. +if test "$GNUSTEP_MAKE_CONFIG" = ""; then + GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` +fi + AC_ARG_WITH(config-file, [ --with-config-file=PATH Specify path to the GNUstep config file. This is the location to be used by the base From a80f6eb37931c791536135a20a0ee27334cfb5c0 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 21 Sep 2006 08:49:02 +0000 Subject: [PATCH 023/266] MacOS-X compatibility fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23582 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++ Source/NSProcessInfo.m | 91 ++++++++++++++++++++++++++++++++---------- 2 files changed, 75 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index e76452ae3..346740824 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-21 Richard Frith-Macdonald + + * Source/NSProcessInfo.m: ([-operatingSystemName]) conform to + MacOS-X and return NSMACHOperatingSystem rather than darwin etc. + 2006-09-18 Nicola Pero * configure.ac (GNUSTEP_MAKE_CONFIG): Get this config from diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index d26ba0d9e..50411bc12 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -996,49 +996,49 @@ int main(int argc, char *argv[], char *env[]) { NSString *n = [self operatingSystemName]; - if ([n isEqualToString: @"linux-gnu"] == YES) + if ([n isEqualToString: @"NSGNULinuxOperatingSystem"] == YES) { os = NSGNULinuxOperatingSystem; } - else if ([n hasPrefix: @"mingw"] == YES) + else if ([n isEqualToString: @"NSWindowsNTOperatingSystem"] == YES) { os = NSWindowsNTOperatingSystem; } - else if ([n isEqualToString: @"cygwin"] == YES) + else if ([n isEqualToString: @"NSWindows95OperatingSystem"] == YES) + { + os = NSWindows95OperatingSystem; + } + else if ([n isEqualToString: @"NSCygwinOperatingSystem"] == YES) { os = NSCygwinOperatingSystem; } - else if ([n hasPrefix: @"bsd"] == YES) + else if ([n isEqualToString: @"NSBSDOperatingSystem"] == YES) { os = NSBSDOperatingSystem; } - else if ([n hasPrefix: @"freebsd"] == YES) - { - os = NSBSDOperatingSystem; - } - else if ([n hasPrefix: @"netbsd"] == YES) - { - os = NSBSDOperatingSystem; - } - else if ([n hasPrefix: @"openbsd"] == YES) - { - os = NSBSDOperatingSystem; - } - else if ([n isEqualToString: @"beos"] == YES) + else if ([n isEqualToString: @"NSBeOperatingSystem"] == YES) { os = NSBeOperatingSystem; } - else if ([n hasPrefix: @"darwin"] == YES) + else if ([n isEqualToString: @"NSMACHOperatingSystem"] == YES) { os = NSMACHOperatingSystem; } - else if ([n hasPrefix: @"solaris"] == YES) + else if ([n isEqualToString: @"NSSolarisOperatingSystem"] == YES) { os = NSSolarisOperatingSystem; } - else if ([n hasPrefix: @"hpux"] == YES) + else if ([n isEqualToString: @"NSHPUXOperatingSystem"] == YES) { os = NSHPUXOperatingSystem; + } + else if ([n isEqualToString: @"NSSunOSOperatingSystem"] == YES) + { + os = NSSunOSOperatingSystem; + } + else if ([n isEqualToString: @"NSOSF1OperatingSystem"] == YES) + { + os = NSOSF1OperatingSystem; } else { @@ -1058,7 +1058,56 @@ int main(int argc, char *argv[], char *env[]) if (os == nil) { - os = [[NSBundle _gnustep_target_os] copy]; + os = [NSBundle _gnustep_target_os]; + + if ([os hasPrefix: @"linux"] == YES) + { + os = @"NSGNULinuxOperatingSystem"; + } + else if ([os hasPrefix: @"mingw"] == YES) + { + os = @"NSWindowsNTOperatingSystem"; + } + else if ([os isEqualToString: @"cygwin"] == YES) + { + os = @"NSCygwinOperatingSystem"; + } + else if ([os hasPrefix: @"bsd"] == YES + || [os hasPrefix: @"freebsd"] == YES + || [os hasPrefix: @"netbsd"] == YES + || [os hasPrefix: @"openbsd"] == YES) + { + os = @"NSBSDOperatingSystem"; + } + else if ([os hasPrefix: @"beos"] == YES) + { + os = @"NSBeOperatingSystem"; + } + else if ([os hasPrefix: @"darwin"] == YES) + { + os = @"NSMACHOperatingSystem"; + } + else if ([os hasPrefix: @"solaris"] == YES) + { + os = @"NSSolarisOperatingSystem"; + } + else if ([os hasPrefix: @"hpux"] == YES) + { + os = @"NSHPUXOperatingSystem"; + } + else if ([os hasPrefix: @"sunos"] == YES) + { + os = @"NSSunOSOperatingSystem"; + } + else if ([os hasPrefix: @"osf"] == YES) + { + os = @"NSOSF10OperatingSystem"; + } + else + { + NSLog(@"Unable to determine O/S ... assuming GNU/Linux"); + os = @"NSGNULinuxOperatingSystem"; + } } return os; } From 273f267524b8005d70d5d70c26ee6b0b3f65593a Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 26 Sep 2006 11:16:06 +0000 Subject: [PATCH 024/266] Fix error in adding percent escapes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23622 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 +++++ Source/NSPathUtilities.m | 33 +++++++++++++++++------- Source/NSString.m | 54 +++++++++++----------------------------- 3 files changed, 45 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 346740824..6574329dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-26 Richard Frith-Macdonald + + * Source/NSString.m: ([stringByAddingPercentEscapesUsingEncoding:]) + Fix to escape '@' (in fact anything not unreserved acording to + RFC2396) + 2006-09-21 Richard Frith-Macdonald * Source/NSProcessInfo.m: ([-operatingSystemName]) conform to diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index a796fc5a4..7d516e7ff 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -145,7 +145,8 @@ static NSString *gnustepUserDir = nil; static NSString *gnustepUserHome = nil; static NSString *gnustepUserDefaultsDir = nil; -static NSString *theUserName = nil; /* The user's login name */ +static NSString *theUserName = nil; /* The user's login name */ +static NSString *theFullUserName = nil; /* The user's full login name */ static NSString *tempDir = nil; /* user's temporary directory */ static NSString *osSysApps = nil; @@ -969,6 +970,7 @@ GSSetUserName(NSString *aName) * Reset things as new user */ ASSIGN(theUserName, aName); + DESTROY(theFullUserName); InitialisePathUtilities(); [NSUserDefaults resetStandardUserDefaults]; @@ -980,7 +982,8 @@ GSSetUserName(NSString *aName) * Under unix-like systems, the name associated with the current * effective user ID is used.
* Under ms-windows, the 'LOGNAME' environment is used, or if that fails, the - * GetUserName() call is used to find the user name. + * GetUserName() call is used to find the user name.
+ * Raises an exception on failure. */ /* NOTE FOR DEVELOPERS. * If you change the behavior of this method you must also change @@ -1129,20 +1132,32 @@ NSHomeDirectoryForUser(NSString *loginName) NSString * NSFullUserName(void) { + if (theFullUserName == nil) + { + NSString *userName = NSUserName(); #if defined(__MINGW32__) - /* FIXME: Win32 way to get full user name via Net API */ - return NSUserName(); + struct _USER_INFO_2 *userInfo; + + NSString *userName = NSUserName(); + if (NetUserGetInfo(NULL, UniBuf(userName), 2, (LPBYTE*)&userInfo) == 0) + { + userName = [NSString stringWithCharacters: userInfo->usri2_full_name + length: wcslen(userInfo->usri2_full_name)]; + } #else #ifdef HAVE_PWD_H - struct passwd *pw; + struct passwd *pw; - pw = getpwnam([NSUserName() cString]); - return [NSString stringWithCString: pw->pw_gecos]; + pw = getpwnam([NSUserName() cString]); + userName = [NSString stringWithCString: pw->pw_gecos]; #else - NSLog(@"Warning: NSFullUserName not implemented\n"); - return NSUserName(); + NSLog(@"Warning: NSFullUserName not implemented\n"); + userName = NSUserName(); #endif /* HAVE_PWD_H */ #endif /* defined(__Win32__) else */ + ASSIGN(theFullUserName, userName); + } + return theFullUserName; } /** diff --git a/Source/NSString.m b/Source/NSString.m index d7396cbe5..bec1fde06 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -1328,6 +1328,9 @@ handle_printf_atsign (FILE *stream, * Constructs a new ASCII string which is a representation of the receiver * in which characters are escaped where necessary in order to produce a * legal URL.
+ * Escaping is done for any character which is not 'unreserved' according + * to RFC2396. The unreserved characters are letters, digits, and the + * set of 'marks' characters ("-_.!~*'()").
* Returns nil if the receiver cannot be represented using the specified * encoding. */ @@ -1351,46 +1354,19 @@ handle_printf_atsign (FILE *stream, unsigned int hi; unsigned int lo; - switch (c) + if (isalpha(c) || isdigit(c) + || c == '-' || c == '_' || c == '.' || c == '!' || c == '~' + || c == '*' || c == '\'' || c == '(' || c == ')') { - case ',': - case ';': - case '"': - case '\'': - case '&': - case '=': - case '(': - case ')': - case '<': - case '>': - case '?': - case '#': - case '{': - case '}': - case '%': - case ' ': - case '+': - dst[dpos++] = '%'; - hi = (c & 0xf0) >> 4; - dst[dpos++] = (hi > 9) ? 'A' + hi - 10 : '0' + hi; - lo = (c & 0x0f); - dst[dpos++] = (lo > 9) ? 'A' + lo - 10 : '0' + lo; - break; - - default: - if (c < ' ' || c > 127) - { - dst[dpos++] = '%'; - hi = (c & 0xf0) >> 4; - dst[dpos++] = (hi > 9) ? 'A' + hi - 10 : '0' + hi; - lo = (c & 0x0f); - dst[dpos++] = (lo > 9) ? 'A' + lo - 10 : '0' + lo; - } - else - { - dst[dpos++] = c; - } - break; + dst[dpos++] = c; + } + else + { + dst[dpos++] = '%'; + hi = (c & 0xf0) >> 4; + dst[dpos++] = (hi > 9) ? 'A' + hi - 10 : '0' + hi; + lo = (c & 0x0f); + dst[dpos++] = (lo > 9) ? 'A' + lo - 10 : '0' + lo; } } [d setLength: dpos]; From 34536a0d18ad4952238eeab493072ee34dbd4c92 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 26 Sep 2006 11:50:11 +0000 Subject: [PATCH 025/266] fix missing include git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23624 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 1 + Source/NSPathUtilities.m | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6574329dd..bb51a0a0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * Source/NSString.m: ([stringByAddingPercentEscapesUsingEncoding:]) Fix to escape '@' (in fact anything not unreserved acording to RFC2396) + * Source/NSPathUtilities.m: Fix missing include. 2006-09-21 Richard Frith-Macdonald diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index 7d516e7ff..250a4378f 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -119,6 +119,9 @@ static NSString *gnustep_flattened = #endif #if defined(__MINGW32__) + +#include + /* * FIXME ... should check access properly if the file is on an NTFS volume. */ @@ -1138,8 +1141,8 @@ NSFullUserName(void) #if defined(__MINGW32__) struct _USER_INFO_2 *userInfo; - NSString *userName = NSUserName(); - if (NetUserGetInfo(NULL, UniBuf(userName), 2, (LPBYTE*)&userInfo) == 0) + if (NetUserGetInfo(NULL, (unichar*)[userName cStringUsingEncoding: + NSUnicodeStringEncoding], 2, (LPBYTE*)&userInfo) == 0) { userName = [NSString stringWithCharacters: userInfo->usri2_full_name length: wcslen(userInfo->usri2_full_name)]; From cfaf083d909015bdadf65e26ba1a93456af46ee3 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 28 Sep 2006 18:55:03 +0000 Subject: [PATCH 026/266] framework loading fix added. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23658 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSBundle.m | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb51a0a0e..57e756ffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-28 Richard Frith-Macdonald + + * Source/NSBundle.m: Fix for buffer resize error when registering + framework info, as suggested by Andreas Hoschler. + 2006-09-26 Richard Frith-Macdonald * Source/NSString.m: ([stringByAddingPercentEscapesUsingEncoding:]) diff --git a/Source/NSBundle.m b/Source/NSBundle.m index ce9ec9dfb..0546aed75 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -746,7 +746,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) library_combo = RETAIN(str); _launchDirectory = RETAIN([[NSFileManager defaultManager] - currentDirectoryPath]); + currentDirectoryPath]); _gnustep_bundle = RETAIN([self bundleForLibrary: @"gnustep-base"]); @@ -790,15 +790,15 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) { Class *ptr; - numClasses += 10; - ptr = objc_realloc(classes, sizeof(Class) * numClasses); + numBufClasses += 10; + ptr = objc_realloc(classes, sizeof(Class) * numBufClasses); if (!ptr) break; classes = ptr; } - } + } for (i = 0; i < numClasses; i++) { From 6aec2db2f8086c4173f9c2e2f14a270b59445ad7 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Mon, 2 Oct 2006 16:06:37 +0000 Subject: [PATCH 027/266] Use the new GNUSTEP_IS_FLATTENED variable, and default to flattened if nothing better specified git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23719 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 26 ++++++++++++++++++++++++++ SSL/configure | 6 +++--- SSL/configure.ac | 6 +++--- Source/GNUmakefile | 4 ++-- Source/NSPathUtilities.m | 10 +++++----- configure | 15 +++++++++------ configure.ac | 17 ++++++++++------- 7 files changed, 58 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57e756ffe..2dc325a7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2006-10-02 Nicola Pero + + More work on having the default flattened gnustep build with just + GNUSTEP_MAKEFILES set. Non-flattened builds will still require + sourcing GNUstep.sh before configure instead. + + * configure.ac: Use new variable GNUSTEP_IS_FLATTENED instead + of GNUSTEP_FLATTENED, defaulting now to 'yes'. To build + non-flattened you have to source GNUstep.sh first. + * configure.ac (config.make): When determining objc threading + flags in non-flattened mode, look for config.make in a + library-combo subdir since that's where it is installed by + gnustep-make now. + * configure.ac: Extended the error message when the GNUstep conf + file is not found. + * configure: Regenerated. + + * SSL/configure.ac: Use GNUSTEP_IS_FLATTENED instead of + GNUSTEP_FLATTENED. + * SSL/configure: Regenerated. + + * Source/GNUmakefile: Renamed -DGNUSTEP_FLATTENED to + -DGNUSTEP_IS_FLATTENED. This is just for consistency + with the new gnustep-make variable name. + * Source/NSPathUtilities.m: Same changes. + 2006-09-28 Richard Frith-Macdonald * Source/NSBundle.m: Fix for buffer resize error when registering diff --git a/SSL/configure b/SSL/configure index b67b2efb5..d9cf8874a 100755 --- a/SSL/configure +++ b/SSL/configure @@ -1350,13 +1350,13 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. #-------------------------------------------------------------------- # Set location of GNUstep dirs for later use GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Headers -if test "$GNUSTEP_FLATTENED" = yes; then - GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Libraries -else +if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Libraries/$obj_dir +else + GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Libraries fi # diff --git a/SSL/configure.ac b/SSL/configure.ac index acada4258..d3f92e8e0 100644 --- a/SSL/configure.ac +++ b/SSL/configure.ac @@ -42,13 +42,13 @@ AC_CONFIG_AUX_DIR($GNUSTEP_MAKEFILES) #-------------------------------------------------------------------- # Set location of GNUstep dirs for later use GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Headers -if test "$GNUSTEP_FLATTENED" = yes; then - GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Libraries -else +if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Libraries/$obj_dir +else + GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Libraries fi # diff --git a/Source/GNUmakefile b/Source/GNUmakefile index accff0355..bfbeff2af 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -62,7 +62,7 @@ ifeq ($(GNUSTEP_TARGET_OS), mingw32) DEFS= -DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \ -DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \ -DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \ - -DGNUSTEP_FLATTENED=\"$(GNUSTEP_FLATTENED)\" \ + -DGNUSTEP_IS_FLATTENED=\"$(GNUSTEP_IS_FLATTENED)\" \ -DLIBRARY_COMBO=\"$(LIBRARY_COMBO)\" @@ -71,7 +71,7 @@ else DEFS= -DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \ -DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \ -DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \ - -DGNUSTEP_FLATTENED=\"$(GNUSTEP_FLATTENED)\" \ + -DGNUSTEP_IS_FLATTENED=\"$(GNUSTEP_IS_FLATTENED)\" \ -DLIBRARY_COMBO=\"$(LIBRARY_COMBO)\" endif diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index 250a4378f..e4ce18267 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -111,9 +111,9 @@ static NSString *library_combo = #else nil; #endif -static NSString *gnustep_flattened = -#ifdef GNUSTEP_FLATTENED - @GNUSTEP_FLATTENED; +static NSString *gnustep_is_flattened = +#ifdef GNUSTEP_IS_FLATTENED + @GNUSTEP_IS_FLATTENED; #else nil; #endif @@ -1647,7 +1647,7 @@ if (domainMask & mask) \ NSString *part = nil; gslibsDir = [libraryDir stringByAppendingPathComponent: libsDir]; - if ([gnustep_flattened boolValue] == NO + if ([gnustep_is_flattened boolValue] == NO && gnustep_target_cpu != nil && gnustep_target_os != nil) { part = [gnustep_target_cpu stringByAppendingPathComponent: @@ -1684,7 +1684,7 @@ if (domainMask & mask) \ NSString *full = nil; NSString *part = nil; - if ([gnustep_flattened boolValue] == NO + if ([gnustep_is_flattened boolValue] == NO && gnustep_target_cpu != nil && gnustep_target_os != nil) { part = [gnustep_target_cpu stringByAppendingPathComponent: diff --git a/configure b/configure index 1d2451476..ac5a799eb 100755 --- a/configure +++ b/configure @@ -2214,7 +2214,7 @@ _ACEOF # building the base library ... as supplied by the gnustep-make package # if test ! -f "$GNUSTEP_MAKE_CONFIG"; then - { echo "$as_me:$LINENO: Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now..." >&5 + { echo "$as_me:$LINENO: Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now... but it will probably fail later on" >&5 echo "$as_me: Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now..." >&6;} else . "$GNUSTEP_MAKE_CONFIG" @@ -3628,15 +3628,18 @@ fi # Miscellaneous flags #-------------------------------------------------------------------- # Set location of GNUstep dirs for later use -if test "$GNUSTEP_FLATTENED" = yes; then - GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries - GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers -else +if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os + lobj_dir=$clean_target_cpu/$clean_target_os/$LIBRARY_COMBO GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries/$obj_dir GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers/$LIBRARY_COMBO +else + obj_dir= + lobj_dir= + GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries + GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers fi # @@ -4424,7 +4427,7 @@ echo $ECHO_N "checking for objc threading flags... $ECHO_C" >&6; } # # Get them from gnustep-make which contains the real code to get them # -objc_threaded=`grep objc_threaded: $GNUSTEP_MAKEFILES/$obj_dir/config.make | sed -e 's/objc_threaded:=//'` +objc_threaded=`grep objc_threaded: $GNUSTEP_MAKEFILES/$lobj_dir/config.make | sed -e 's/objc_threaded:=//'` # { echo "$as_me:$LINENO: result: $objc_threaded" >&5 echo "${ECHO_T}$objc_threaded" >&6; } diff --git a/configure.ac b/configure.ac index 473a55717..154d5175c 100644 --- a/configure.ac +++ b/configure.ac @@ -201,7 +201,7 @@ then is found at runtime. If this is not specified then the path from --with-config-file or from the gnustep-make package is used.], - result="$withval", + result="$withval", result="no" ) if test "$result" != "no" @@ -271,7 +271,7 @@ AC_DEFINE_UNQUOTED(GNUSTEP_TARGET_CONFIG_FILE, # building the base library ... as supplied by the gnustep-make package # if test ! -f "$GNUSTEP_MAKE_CONFIG"; then - AC_MSG_NOTICE([Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now...]) + AC_MSG_NOTICE([Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now... but it will probably fail later on]) else . "$GNUSTEP_MAKE_CONFIG" fi @@ -340,15 +340,18 @@ fi # Miscellaneous flags #-------------------------------------------------------------------- # Set location of GNUstep dirs for later use -if test "$GNUSTEP_FLATTENED" = yes; then - GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries - GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers -else +if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os + lobj_dir=$clean_target_cpu/$clean_target_os/$LIBRARY_COMBO GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries/$obj_dir GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers/$LIBRARY_COMBO +else + obj_dir= + lobj_dir= + GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries + GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers fi # @@ -422,7 +425,7 @@ AC_MSG_CHECKING(for objc threading flags) # # Get them from gnustep-make which contains the real code to get them # -objc_threaded=`grep objc_threaded: $GNUSTEP_MAKEFILES/$obj_dir/config.make | sed -e 's/objc_threaded:=//'` +objc_threaded=`grep objc_threaded: $GNUSTEP_MAKEFILES/$lobj_dir/config.make | sed -e 's/objc_threaded:=//'` # AC_MSG_RESULT($objc_threaded) From 1f73d84b0dc4c9b607f57e4ebfc30815ef55f5e2 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 3 Oct 2006 13:35:50 +0000 Subject: [PATCH 028/266] Cleanups and updates to be compatible with current MacOS-X git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23735 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 12 + Headers/Additions/GNUstepBase/config.h.in | 19 +- Headers/Foundation/NSObject.h | 6 +- Headers/Foundation/NSProcessInfo.h | 180 ++++++++- Source/NSProcessInfo.m | 282 +++++--------- Testing/nsprocessinfo.m | 15 +- Version | 4 +- configure | 435 +++++++++++++++------- configure.ac | 5 + 9 files changed, 613 insertions(+), 345 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2dc325a7a..b826b4887 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-10-03 Richard Frith-Macdonald + + * Version: Bump to version for next release. + * configure.ac: Check for utsname + * configure: Regenerate + * Headers/Additions/GNUstepBase/config.h.in: Regenerate + * Headers/Foundation/NSObject.h: Small documentaion improvement + * Headers/Foundation/NSProcessInfo.h: Add documentation and update. + * Source/NSProcessInfo.m: Moved documentation to header, clean up + and complete operating system code. + * Testing/nsprocessinfo.m: Trivial test updates. Avoid use of cString + 2006-10-02 Nicola Pero More work on having the default flattened gnustep build with just diff --git a/Headers/Additions/GNUstepBase/config.h.in b/Headers/Additions/GNUstepBase/config.h.in index 642748fd9..942326052 100644 --- a/Headers/Additions/GNUstepBase/config.h.in +++ b/Headers/Additions/GNUstepBase/config.h.in @@ -330,6 +330,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UTSNAME_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H @@ -414,25 +417,25 @@ /* Define to 1 if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID -/* The size of a `double', as computed by sizeof. */ +/* The size of `double', as computed by sizeof. */ #undef SIZEOF_DOUBLE -/* The size of a `float', as computed by sizeof. */ +/* The size of `float', as computed by sizeof. */ #undef SIZEOF_FLOAT -/* The size of a `int', as computed by sizeof. */ +/* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `long long', as computed by sizeof. */ +/* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* The size of a `short', as computed by sizeof. */ +/* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT -/* The size of a `void*', as computed by sizeof. */ +/* The size of `void*', as computed by sizeof. */ #undef SIZEOF_VOIDP /* Define to 1 if you have the ANSI C header files. */ @@ -460,5 +463,5 @@ #undef inline #endif -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t diff --git a/Headers/Foundation/NSObject.h b/Headers/Foundation/NSObject.h index 803fe3998..1808bc801 100644 --- a/Headers/Foundation/NSObject.h +++ b/Headers/Foundation/NSObject.h @@ -114,8 +114,10 @@ extern "C" { (!defined(GS_OPENSTEP_V) || (GS_OPENSTEP_V >= ADD && GS_OPENSTEP_V < REM)) /** - * A constant to represent a feature which is not present in any version. - * Use this to say a feature is not present in an API.
+ * A constant which is the lowest possible version number (0) so that + * when used as the removal version (second argument of the GS_API_VERSION + * or OS_API_VERSION macro) represents a feature which is not present in + * any version.
* eg.
* #if OS_API_VERSION * (GS_API_NONE, GS_API_NONE)
diff --git a/Headers/Foundation/NSProcessInfo.h b/Headers/Foundation/NSProcessInfo.h index c9c952ff3..3fbadf96b 100644 --- a/Headers/Foundation/NSProcessInfo.h +++ b/Headers/Foundation/NSProcessInfo.h @@ -39,12 +39,14 @@ extern "C" { @class NSData; @class NSMutableSet; -#ifndef STRICT_OPENSTEP -/* - * Constants returned by -operatingSystem +#if OS_API_VERSION(GS_API_MACOSX,GS_API_LATEST) + +/** + * Constants returned by the -operatingSystem method. * NB. The presence of a constant in this list does *NOT* imply that * the named operating system is supported. Some values are provided - * for MacOS-X compatibility only. + * for MacOS-X compatibility or are obsolete and provided for + * backward compatibility. */ enum { NSWindowsNTOperatingSystem = 1, @@ -54,52 +56,200 @@ enum { NSMACHOperatingSystem, NSSunOSOperatingSystem, NSOSF1OperatingSystem, - NSGNULinuxOperatingSystem = 100, - NSBSDOperatingSystem, - NSBeOperatingSystem, - NSCygwinOperatingSystem +#if OS_API_VERSION(GS_API_NONE,GS_API_NONE) + GSGNULinuxOperatingSystem = 100, + GSBSDOperatingSystem, + GSBeOperatingSystem, + GSCygwinOperatingSystem + +#if GS_API_VERSION(0,011500) +// Defines of deprecated constants for backward compatibility +#define NSGNULinuxOperatingSystem GSGNULinuxOperatingSystem +#define NSBSDOperatingSystem GSBSDOperatingSystem +#define NSBeOperatingSystem GSBeOperatingSystem +#define NSCygwinOperatingSystem GSCygwinOperatingSystem +#endif /* GS_API_VERSION(0,011500) */ + +#endif /* OS_API_VERSION(GS_API_NONE,GS_API_NONE) */ }; -#endif +#endif /* OS_API_VERSION(GS_API_MACOSX,GS_API_LATEST) */ @interface NSProcessInfo: NSObject +/** + * Returns the shared NSProcessInfo object for the current process. + */ + (NSProcessInfo*) processInfo; +/** + * Returns an array containing the arguments supplied to start this + * process.
+ * NB. In GNUstep, any arguments of the form --GNU-Debug=... + * are not included in this array ... they are part of the + * debug mechanism, and are hidden so that setting debug variables + * will not effect the normal operation of the program.
+ * Please note, the special --GNU-Debug=... syntax differs from + * that which is used to specify values for the [NSUserDefaults] system.
+ * User defaults are set on the command line by specifying the default name + * (with a leading hyphen) as one argument, and the default value as the + * following argument. The arguments used to set user defaults are + * present in the array returned by this method. + */ - (NSArray*) arguments; + +/** + * Returns a dictionary giving the environment variables which were + * provided for the process to use. + */ - (NSDictionary*) environment; + +/** + * Returns a string which may be used as a globally unique identifier.
+ * The string contains the host name, the process ID, a timestamp and a + * counter.
+ * The first three values identify the process in which the string is + * generated, while the fourth ensures that multiple strings generated + * within the same process are unique. + */ - (NSString*) globallyUniqueString; + +/** + * Returns the name of the machine on which this process is running. + */ - (NSString*) hostName; -#ifndef STRICT_OPENSTEP + +#if OS_API_VERSION(GS_API_MACOSX,GS_API_LATEST) + +/** + * Return a number representing the operating system type.
+ * The known types are listed in the header file, but not all of the + * listed types are actually implemented ... some are present for + * MacOS-X compatibility only.
+ * + * NSWindowsNTOperatingSystem - used for Windows NT, and later + * NSWindows95OperatingSystem - probably never to be implemented + * NSSolarisOperatingSystem - used for Sun Solaris + * NSHPUXOperatingSystem - used for HP/UX + * NSMACHOperatingSystem - MacOSX and perhaps Hurd in future? + * NSSunOSOperatingSystem - Used for Sun Sun/OS + * NSOSF1OperatingSystem - Used for OSF/1 (probably obsolete) + * GSGNULinuxOperatingSystem - the GNUstep 'standard' + * GSBSDOperatingSystem - BSD derived operating systems + * GSBeperatingSystem - Used for Be-OS (probably obsolete) + * GSCygwinOperatingSystem - cygwin unix-like environment + * + */ - (unsigned int) operatingSystem; + +/** + * Return a human readable string representing the operating system type.
+ * The supported types are - + * + * NSWindowsNTOperatingSystem - used for Windows NT, and later + * NSWindows95OperatingSystem - probably never to be implemented + * NSSolarisOperatingSystem - used for Sun Solaris + * NSHPUXOperatingSystem - used for HP/UX + * NSMACHOperatingSystem - MacOSX and perhaps Hurd in future? + * NSSunOSOperatingSystem - Used for Sun Sun/OS + * NSOSF1OperatingSystem - Used for OSF/1 (probably obsolete) + * GSGNULinuxOperatingSystem - the GNUstep 'standard' + * GSBSDOperatingSystem - BSD derived operating systems + * GSBeperatingSystem - Used for Be-OS (probably obsolete) + * GSCygwinOperatingSystem - cygwin unix-like environment + * + */ - (NSString*) operatingSystemName; + +/** + * Returns a human readable version string for the current operating system + * version. + */ +#if OS_API_VERSION(100200,GS_API_LATEST) +- (NSString *) operatingSystemVersionString; +#endif + +/** + * Returns the process identifier number which uniquely identifies + * this process on this machine. + */ - (int) processIdentifier; #endif + +/** + * Returns the process name for this process. This may have been set using + * the -setProcessName: method, or may be the default process name (the + * file name of the binary being executed). + */ - (NSString*) processName; +/** + * Change the name of the current process to newName. + */ - (void) setProcessName: (NSString*)newName; @end -#ifndef NO_GNUSTEP +#if OS_API_VERSION(GS_API_NONE,GS_API_NONE) +/** + * Provides GNUstep-specific methods for controlled debug logging (a GNUstep + * facility) and an internal/developer-related method. + */ @interface NSProcessInfo (GNUstep) + +/** + * Returns a indication of whether debug logging is enabled. + * This returns YES unless a call to -setDebugLoggingEnabled: has + * been used to turn logging off. + */ - (BOOL) debugLoggingEnabled; + +/** + * This method returns a set of debug levels set using the + * --GNU-Debug=... command line option and/or the GNU-Debug + * user default.
+ * You can modify this set to change the debug logging under + * your programs control ... but such modifications are not + * thread-safe. + */ - (NSMutableSet*) debugSet; + +/** + * This method permits you to turn all debug logging on or off + * without modifying the set of debug levels in use. + */ - (void) setDebugLoggingEnabled: (BOOL)flag; + +/** + * Set the file to which NSLog output should be directed.
+ * Returns YES on success, NO on failure.
+ * By default logging goes to standard error. + */ - (BOOL) setLogFile: (NSString*)path; + +/** + * Fallback/override method. The developer must call this method to initialize + * the NSProcessInfo system if none of the system-specific hacks to + * auto-initialize it are working.
+ * It is also safe to call this method to override the effects + * of the automatic initialisation, which some applications may need + * to do when using GNUstep libraries embeddedm within other frameworks. + */ + (void) initializeWithArguments: (char**)argv count: (int)argc environment: (char**)env; @end -/* - * This function determines if the specified debug level is present in the - * set of active debug levels. +/** + * Function for rapid testing to see if a debug level is set.
+ * This is used by the debugging macros.
+ * If debug logging has been turned off, this returns NO even if + * the specified level exists in the set of debug levels. */ GS_EXPORT BOOL GSDebugSet(NSString *level); -#endif +#endif /* GS_API_NONE */ #if defined(__cplusplus) } diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 50411bc12..d1925a6b2 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -71,6 +71,9 @@ #ifdef HAVE_SYS_FCNTL_H #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif #ifdef HAVE_KVM_ENV #include @@ -97,6 +100,7 @@ #include "Foundation/NSAutoreleasePool.h" #include "Foundation/NSHost.h" #include "Foundation/NSLock.h" +#include "Foundation/NSDebug.h" #include "GNUstepBase/GSCategories.h" #include "GSPrivate.h" @@ -194,11 +198,17 @@ static NSArray *_gnu_arguments = nil; // Dictionary of environment vars and their values static NSMutableDictionary *_gnu_environment = nil; +// The operating system we are using. +static unsigned int _operatingSystem = 0; +static NSString *_operatingSystemName = nil; +static NSString *_operatingSystemVersion = nil; + // Array of debug levels set. static NSMutableSet *_debug_set = nil; // Flag to indicate that fallbackInitialisation was executed. static BOOL fallbackInitialisation = NO; + /************************************************************************* *** Implementing the gnustep_base_user_main function *************************************************************************/ @@ -874,9 +884,6 @@ int main(int argc, char *argv[], char *env[]) #endif /* HAS_LOAD_METHOD && HAS_PROCFS */ -/** - * Returns the shared NSProcessInfo object for the current process. - */ + (NSProcessInfo *) processInfo { // Check if the main() function was successfully called @@ -895,42 +902,16 @@ int main(int argc, char *argv[], char *env[]) return _gnu_sharedProcessInfoObject; } -/** - * Returns an array containing the arguments supplied to start this - * process.
- * NB. In GNUstep, any arguments of the form --GNU-Debug=... - * are not included in this array ... they are part of the - * debug mechanism, and are hidden so that setting debug variables - * will not effect the normal operation of the program.
- * Please note, the special --GNU-Debug=... syntax differs from - * that which is used to specify values for the [NSUserDefaults] system.
- * User defaults are set on the command line by specifying the default name - * (with a leading hyphen) as one argument, and the default value as the - * following argument. The arguments used to set user defaults are - * present in the array returned by this method. - */ - (NSArray *) arguments { return _gnu_arguments; } -/** - * Returns a dictionary giving the environment variables which were - * provided for the process to use. - */ - (NSDictionary *) environment { return _gnu_environment; } -/** - * Returns a string which may be used as a globally unique identifier.
- * The string contains the host name, the process ID, a timestamp and a - * counter.
- * The first three values identify the process in which the string is - * generated, while the fourth ensures that multiple strings generated - * within the same process are unique. - */ - (NSString *) globallyUniqueString { static unsigned long counter = 0; @@ -958,9 +939,6 @@ int main(int argc, char *argv[], char *env[]) host, pid, start, count]; } -/** - * Returns the name of the machine on which this process is running. - */ - (NSString *) hostName { if (!_gnu_hostName) @@ -970,152 +948,138 @@ int main(int argc, char *argv[], char *env[]) return _gnu_hostName; } -/** - * Return a number representing the operating system type.
- * The known types are listed in the header file, but not all of the - * listed types are actually implemented ... some are present for - * MacOS-X compatibility only.
- * - * NSWindowsNTOperatingSystem - used for windows NT, 2000, XP - * NSWindows95OperatingSystem - probably never to be implemented - * NSSolarisOperatingSystem - not yet recognised - * NSHPUXOperatingSystem - not implemented - * NSMACHOperatingSystem - perhaps the HURD in future? - * NSSunOSOperatingSystem - probably never to be implemented - * NSOSF1OperatingSystem - probably never to be implemented - * NSGNULinuxOperatingSystem - the GNUstep 'standard' - * NSBSDOperatingSystem - BSD derived operating systems - * NSCygwinOperatingSystem - cygwin unix-like environment - * - */ -- (unsigned int) operatingSystem +static void determineOperatingSystem() { - static unsigned int os = 0; - - if (os == 0) + if (_operatingSystem == 0) { - NSString *n = [self operatingSystemName]; + NSString *os = [NSBundle _gnustep_target_os]; - if ([n isEqualToString: @"NSGNULinuxOperatingSystem"] == YES) - { - os = NSGNULinuxOperatingSystem; - } - else if ([n isEqualToString: @"NSWindowsNTOperatingSystem"] == YES) - { - os = NSWindowsNTOperatingSystem; - } - else if ([n isEqualToString: @"NSWindows95OperatingSystem"] == YES) - { - os = NSWindows95OperatingSystem; - } - else if ([n isEqualToString: @"NSCygwinOperatingSystem"] == YES) - { - os = NSCygwinOperatingSystem; - } - else if ([n isEqualToString: @"NSBSDOperatingSystem"] == YES) - { - os = NSBSDOperatingSystem; - } - else if ([n isEqualToString: @"NSBeOperatingSystem"] == YES) - { - os = NSBeOperatingSystem; - } - else if ([n isEqualToString: @"NSMACHOperatingSystem"] == YES) - { - os = NSMACHOperatingSystem; - } - else if ([n isEqualToString: @"NSSolarisOperatingSystem"] == YES) - { - os = NSSolarisOperatingSystem; - } - else if ([n isEqualToString: @"NSHPUXOperatingSystem"] == YES) - { - os = NSHPUXOperatingSystem; - } - else if ([n isEqualToString: @"NSSunOSOperatingSystem"] == YES) - { - os = NSSunOSOperatingSystem; - } - else if ([n isEqualToString: @"NSOSF1OperatingSystem"] == YES) - { - os = NSOSF1OperatingSystem; - } - else - { - NSLog(@"Unable to determine O/S ... assuming GNU/Linux"); - os = NSGNULinuxOperatingSystem; - } - } - return os; -} +#if defined(__MINGW32__) + OSVERSIONINFOW osver; -/** - * Returns the name of the operating system in use. - */ -- (NSString*) operatingSystemName -{ - static NSString *os = nil; + osver.dwOSVersionInfoSize = sizeof(osver); + GetVersionExW (&osver); + /* Hmm, we could use this to determine operating system version, but + * that would not distinguish between mingw and cygwin, so we just + * use the information from NSBundle and only get the version info + * here. + */ + _operatingSystemVersion = [[NSString alloc] initWithFormat: @"%d.%d", + osver.dwMajorVersion, osver.dwMinorVersion]; +#else +#if defined(HAVE_SYS_UTSNAME_H) + struct utsname uts; - if (os == nil) - { - os = [NSBundle _gnustep_target_os]; + /* The system supports uname, so we can use it rather than the + * value determined at configure/compile time. + * That's good if the binary is running on a system other than + * the one it was built for (rare, but can happen). + */ + if (uname(&uts) == 0) + { + os = [NSString stringWithCString: uts.sysname encoding: [NSString defaultCStringEncoding]]; + _operatingSystemVersion = [[NSString alloc] + initWithCString: uts.version + encoding: [NSString defaultCStringEncoding]]; + } +#endif /* HAVE_SYS_UTSNAME_H */ +#endif /* __MINGW32__ */ + + if (_operatingSystemVersion == nil) + { + NSWarnFLog(@"Unable to determine system version, using 0.0"); + _operatingSystemVersion = @"0.0"; + } if ([os hasPrefix: @"linux"] == YES) { - os = @"NSGNULinuxOperatingSystem"; + _operatingSystemName = @"GSGNULinuxOperatingSystem"; + _operatingSystem = GSGNULinuxOperatingSystem; } else if ([os hasPrefix: @"mingw"] == YES) { - os = @"NSWindowsNTOperatingSystem"; + _operatingSystemName = @"NSWindowsNTOperatingSystem"; + _operatingSystem = NSWindowsNTOperatingSystem; } else if ([os isEqualToString: @"cygwin"] == YES) { - os = @"NSCygwinOperatingSystem"; + _operatingSystemName = @"GSCygwinOperatingSystem"; + _operatingSystem = GSCygwinOperatingSystem; } else if ([os hasPrefix: @"bsd"] == YES || [os hasPrefix: @"freebsd"] == YES || [os hasPrefix: @"netbsd"] == YES || [os hasPrefix: @"openbsd"] == YES) { - os = @"NSBSDOperatingSystem"; + _operatingSystemName = @"GSBSDOperatingSystem"; + _operatingSystem = GSBSDOperatingSystem; } else if ([os hasPrefix: @"beos"] == YES) { - os = @"NSBeOperatingSystem"; + _operatingSystemName = @"GSBeOperatingSystem"; + _operatingSystem = GSBeOperatingSystem; } else if ([os hasPrefix: @"darwin"] == YES) { - os = @"NSMACHOperatingSystem"; + _operatingSystemName = @"NSMACHOperatingSystem"; + _operatingSystem = NSMACHOperatingSystem; } else if ([os hasPrefix: @"solaris"] == YES) { - os = @"NSSolarisOperatingSystem"; + _operatingSystemName = @"NSSolarisOperatingSystem"; + _operatingSystem = NSSolarisOperatingSystem; } else if ([os hasPrefix: @"hpux"] == YES) { - os = @"NSHPUXOperatingSystem"; + _operatingSystemName = @"NSHPUXOperatingSystem"; + _operatingSystem = NSHPUXOperatingSystem; } else if ([os hasPrefix: @"sunos"] == YES) { - os = @"NSSunOSOperatingSystem"; + _operatingSystemName = @"NSSunOSOperatingSystem"; + _operatingSystem = NSSunOSOperatingSystem; } else if ([os hasPrefix: @"osf"] == YES) { - os = @"NSOSF10OperatingSystem"; + _operatingSystemName = @"NSOSF1OperatingSystem"; + _operatingSystem = NSOSF1OperatingSystem; } else { - NSLog(@"Unable to determine O/S ... assuming GNU/Linux"); - os = @"NSGNULinuxOperatingSystem"; + NSWarnFLog(@"Unable to determine O/S ... assuming GNU/Linux"); + _operatingSystemName = @"GSGNULinuxOperatingSystem"; + _operatingSystem = GSGNULinuxOperatingSystem; } } - return os; } -/** - * Returns the process identifier number which identifies this process - * on this machine. - */ +- (unsigned int) operatingSystem +{ + if (_operatingSystem == 0) + { + determineOperatingSystem(); + } + return _operatingSystem; +} + +- (NSString*) operatingSystemName +{ + if (_operatingSystemName == 0) + { + determineOperatingSystem(); + } + return _operatingSystemName; +} + +- (NSString *) operatingSystemVersionString +{ + if (_operatingSystemVersion == nil) + { + determineOperatingSystem(); + } + return _operatingSystemVersion; +} + - (int) processIdentifier { int pid; @@ -1128,19 +1092,11 @@ int main(int argc, char *argv[], char *env[]) return pid; } -/** - * Returns the process name for this process. This may have been set using - * the -setProcessName: method, or may be the default process name (the - * file name of the binary being executed). - */ - (NSString *) processName { return _gnu_processName; } -/** - * Change the name of the current process to newName. - */ - (void) setProcessName: (NSString *)newName { if (newName && [newName length]) { @@ -1152,21 +1108,10 @@ int main(int argc, char *argv[], char *env[]) @end -/** - * Provides GNUstep-specific methods for controlled debug logging (a GNUstep - * facility) and an internal/developer-related method. - */ @implementation NSProcessInfo (GNUstep) static BOOL debugTemporarilyDisabled = NO; -/** - * Fallback method. The developer must call this method to initialize - * the NSProcessInfo system if none of the system-specific hacks to - * auto-initialize it are working.
- * It should also be safe to call this method to override the effects - * of the automatic initialisation. - */ + (void) initializeWithArguments: (char**)argv count: (int)argc environment: (char**)env @@ -1177,11 +1122,6 @@ static BOOL debugTemporarilyDisabled = NO; [gnustep_global_lock unlock]; } -/** - * Returns a indication of whether debug logging is enabled. - * This returns YES unless a call to -setDebugLoggingEnabled: has - * been used to turn logging off. - */ - (BOOL) debugLoggingEnabled { if (debugTemporarilyDisabled == YES) @@ -1194,23 +1134,11 @@ static BOOL debugTemporarilyDisabled = NO; } } -/** - * This method returns a set of debug levels set using the - * --GNU-Debug=... command line option and/or the GNU-Debug - * user default.
- * You can modify this set to change the debug logging under - * your programs control ... but such modifications are not - * thread-safe. - */ - (NSMutableSet*) debugSet { return _debug_set; } -/** - * This method permits you to turn all debug logging on or off - * without modifying the set of debug levels in use. - */ - (void) setDebugLoggingEnabled: (BOOL)flag { if (flag == NO) @@ -1223,11 +1151,6 @@ static BOOL debugTemporarilyDisabled = NO; } } -/** - * Set the file to which NSLog output should be directed.
- * Returns YES on success, NO on failure.
- * By default logging goes to standard error. - */ - (BOOL) setLogFile: (NSString*)path { extern int _NSLogDescriptor; @@ -1251,12 +1174,6 @@ static BOOL debugTemporarilyDisabled = NO; } @end -/** - * Function for rapid testing to see if a debug level is set.
- * This is used by the debugging macros.
- * If debug logging has been turned off, this returns NO even if - * the specified level exists in the set of debug levels. - */ BOOL GSDebugSet(NSString *level) { static IMP debugImp = 0; @@ -1282,7 +1199,9 @@ BOOL GSDebugSet(NSString *level) return YES; } - +/** + * Internal function for GNUstep base library + */ BOOL GSEnvironmentFlag(const char *name, BOOL def) { @@ -1312,6 +1231,7 @@ GSEnvironmentFlag(const char *name, BOOL def) } /** + * Internal function for GNUstep base library. * Used by NSException uncaught exception handler - must not call any * methods/functions which might cause a recursive exception. */ diff --git a/Testing/nsprocessinfo.m b/Testing/nsprocessinfo.m index ff1c239c8..e3aeac72f 100644 --- a/Testing/nsprocessinfo.m +++ b/Testing/nsprocessinfo.m @@ -23,24 +23,25 @@ int main(int argc, char *argv[]) NSString* aKey; NSEnumerator* enumerator; - printf("Host name: %s\n",[[pi hostName] cString]); + printf("Host name: %s\n",[[pi hostName] UTF8String]); printf("Operating system: %d\n",[pi operatingSystem]); - printf("Operating system name: %s\n",[[pi operatingSystemName] cString]); - printf("Process Name: %s\n",[[pi processName] cString]); - printf("Globally Unique String: %s\n",[[pi globallyUniqueString] cString]); + printf("Operating system name: %s\n",[[pi operatingSystemName] UTF8String]); + printf("Operating system version: %s\n",[[pi operatingSystemVersionString] UTF8String]); + printf("Process Name: %s\n",[[pi processName] UTF8String]); + printf("Globally Unique String: %s\n",[[pi globallyUniqueString] UTF8String]); printf("\nProcess arguments\n"); printf("%d argument(s)\n", [[pi arguments] count]); enumerator = [[pi arguments] objectEnumerator]; while ((aString = [enumerator nextObject])) - printf("-->%s\n",[aString cString]); + printf("-->%s\n",[aString UTF8String]); printf("\nProcess environment\n"); printf("%d environment variables(s)\n", [[pi environment] count]); enumerator = [[pi environment] keyEnumerator]; while ((aKey = [enumerator nextObject])) - printf("++>%s=%s\n",[aKey cString],[[[pi environment] - objectForKey:aKey] cString]); + printf("++>%s=%s\n",[aKey UTF8String],[[[pi environment] + objectForKey:aKey] UTF8String]); [arp release]; exit(0); diff --git a/Version b/Version index e5f40d7c9..e6359e59c 100644 --- a/Version +++ b/Version @@ -6,10 +6,10 @@ GCC_VERSION=2.9.5 # The version number of this release. MAJOR_VERSION=1 -MINOR_VERSION=13 +MINOR_VERSION=14 SUBMINOR_VERSION=0 # numeric value should match above -VERSION_NUMBER=113.0 +VERSION_NUMBER=114.0 GNUSTEP_BASE_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} VERSION=${GNUSTEP_BASE_VERSION} diff --git a/configure b/configure index ac5a799eb..c1724eba0 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59e. +# Generated by GNU Autoconf 2.60. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -230,8 +230,8 @@ IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do - # Try only shells which exist, to save several forks. - if test -f "$as_shell" && + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -1354,7 +1354,7 @@ Optional Packages: If a trailing '/' is specified, the path is used for locating domains but no GNUstep config file is read at runtime. - --with-default-config=PATH Specify path to a GNUstep config file to be + --with-default-config=PATH Specify path to a GNUstep config file to be imported at configure time (now) and used to provide default values for the base library to use at runtime if no GNUstep config file @@ -1445,7 +1445,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.59e +generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -1459,7 +1459,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59e. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -2004,6 +2004,7 @@ if test "$GNUSTEP_MAKE_CONFIG" = ""; then GNUSTEP_MAKE_CONFIG=`grep '^GNUSTEP_CONFIG_FILE *=' $GNUSTEP_MAKEFILES/config.make | sed -e 's/GNUSTEP_CONFIG_FILE *= *\(.*\)/\1/'` fi + # Check whether --with-config-file was given. if test "${with_config_file+set}" = set; then withval=$with_config_file; result="$withval" @@ -2215,7 +2216,7 @@ _ACEOF # if test ! -f "$GNUSTEP_MAKE_CONFIG"; then { echo "$as_me:$LINENO: Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now... but it will probably fail later on" >&5 -echo "$as_me: Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now..." >&6;} +echo "$as_me: Could not find make-specified config file. Either make was installed incorrectly or you are using an old version of gnustep-make. Ignoring this for now... but it will probably fail later on" >&6;} else . "$GNUSTEP_MAKE_CONFIG" fi @@ -2881,7 +2882,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -3067,13 +3068,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 @@ -3138,6 +3139,11 @@ static char *f (char * (*g) (char **, int), char **p, ...) that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3198,7 +3204,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext @@ -3881,7 +3887,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -4077,7 +4083,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 @@ -4160,7 +4166,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -4332,7 +4338,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 sa_len=0 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $sa_len = 1; then { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } @@ -4558,7 +4564,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4639,7 +4645,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4700,7 +4706,7 @@ fi fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } @@ -4797,7 +4803,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_voidp=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5 echo "${ECHO_T}$ac_cv_type_voidp" >&6; } @@ -4933,7 +4939,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -5058,7 +5064,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -5067,10 +5073,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5134,7 +5140,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_voidp=$ac_lo;; @@ -5303,7 +5309,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } @@ -5439,7 +5445,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -5564,7 +5570,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -5573,10 +5579,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5640,7 +5646,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; @@ -5805,7 +5811,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } @@ -5941,7 +5947,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -6066,7 +6072,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -6075,10 +6081,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -6142,7 +6148,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; @@ -6307,7 +6313,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } @@ -6443,7 +6449,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -6568,7 +6574,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -6577,10 +6583,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -6644,7 +6650,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; @@ -6809,7 +6815,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } @@ -6945,7 +6951,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -7070,7 +7076,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -7079,10 +7085,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -7146,7 +7152,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; @@ -7311,7 +7317,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_float=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 echo "${ECHO_T}$ac_cv_type_float" >&6; } @@ -7447,7 +7453,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -7572,7 +7578,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -7581,10 +7587,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -7648,7 +7654,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; @@ -7813,7 +7819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_double=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 echo "${ECHO_T}$ac_cv_type_double" >&6; } @@ -7949,7 +7955,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -8074,7 +8080,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 @@ -8083,10 +8089,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -8150,7 +8156,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; @@ -8594,7 +8600,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -8749,7 +8755,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -8905,7 +8911,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -9061,7 +9067,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -9234,7 +9240,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dladdr=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -9594,7 +9600,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -9701,7 +9707,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } @@ -9777,7 +9783,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done @@ -9871,7 +9877,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -10065,7 +10071,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -10233,7 +10239,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -10406,7 +10412,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -10571,7 +10577,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -10735,7 +10741,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 @@ -10820,7 +10826,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -10983,7 +10989,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -11104,7 +11110,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -11196,7 +11202,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -11390,7 +11396,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -11500,7 +11506,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -11668,7 +11674,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -11836,7 +11842,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iberty_dyn_string_append=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -11923,7 +11929,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bfd_bfd_openr=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12010,7 +12016,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -12202,7 +12208,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -12288,7 +12294,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -12480,7 +12486,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -12598,7 +12604,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -12800,7 +12806,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13016,7 +13022,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13103,7 +13109,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 @@ -13196,7 +13202,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break @@ -13296,7 +13302,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break @@ -13392,7 +13398,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -13588,7 +13594,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13702,7 +13708,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13816,7 +13822,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13926,7 +13932,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14036,7 +14042,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14152,7 +14158,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14336,7 +14342,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -14581,7 +14587,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14664,7 +14670,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -14832,7 +14838,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_gzseek=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -14957,7 +14963,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -15071,7 +15077,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -15155,7 +15161,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uintmax_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; } @@ -15373,7 +15379,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -15627,7 +15633,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_register_printf_function=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_register_printf_function" >&5 @@ -15791,7 +15797,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -15882,6 +15888,174 @@ else echo "${ECHO_T}no" >&6; } fi +#-------------------------------------------------------------------- +# Check for uname header used by NSProcessInfo.m +#-------------------------------------------------------------------- + +for ac_header in sys/utsname.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + #-------------------------------------------------------------------- # Defines HAVE_PROCFS if the kernel supports the /proc filesystem. # Needed by NSProcessInfo.m @@ -15954,7 +16128,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -16348,7 +16522,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_kvm_kvm_getenvv=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -16658,7 +16832,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -16819,7 +16993,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -16978,7 +17152,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 have_forward_hook=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $have_forward_hook" >&5 echo "${ECHO_T}$have_forward_hook" >&6; } if test $have_forward_hook = no; then @@ -17055,7 +17229,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ffi_ok="no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $ffi_ok = yes; then { echo "$as_me:$LINENO: result: libffi" >&5 @@ -17126,7 +17300,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ffi_ok="no" fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $ffi_ok = yes; then { echo "$as_me:$LINENO: result: ffcall" >&5 @@ -17241,7 +17415,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $found_iconv = no ; then @@ -17329,7 +17503,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi @@ -17400,7 +17574,7 @@ echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi @@ -17894,7 +18068,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -18073,7 +18247,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_xslt_xsltApplyStylesheet=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -18149,7 +18323,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -18398,7 +18572,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } @@ -18566,7 +18740,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gmp_mpf_abs=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -18650,7 +18824,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gmp___gmpf_abs=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -18737,7 +18911,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi -rm -f conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi @@ -19192,7 +19366,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59e. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -19241,7 +19415,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59e, +configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. @@ -19863,6 +20037,7 @@ $ac_datarootdir_hack test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' diff --git a/configure.ac b/configure.ac index 154d5175c..7e4ee0d52 100644 --- a/configure.ac +++ b/configure.ac @@ -1101,6 +1101,11 @@ else AC_MSG_RESULT(no) fi +#-------------------------------------------------------------------- +# Check for uname header used by NSProcessInfo.m +#-------------------------------------------------------------------- +AC_CHECK_HEADERS(sys/utsname.h) + #-------------------------------------------------------------------- # Defines HAVE_PROCFS if the kernel supports the /proc filesystem. # Needed by NSProcessInfo.m From 31be7939a2ed35acf874e796767a435d3883e2df Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 3 Oct 2006 13:42:53 +0000 Subject: [PATCH 029/266] utsname.release is better than utsname.version git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23736 72102866-910b-0410-8b05-ffd578937521 --- Source/NSProcessInfo.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index d1925a6b2..fd77ca284 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -978,8 +978,12 @@ static void determineOperatingSystem() if (uname(&uts) == 0) { os = [NSString stringWithCString: uts.sysname encoding: [NSString defaultCStringEncoding]]; + /* Get the operating system version ... usually the version string + * is pretty horrible, and the kernel release string actually + * makes more sense. + */ _operatingSystemVersion = [[NSString alloc] - initWithCString: uts.version + initWithCString: uts.release encoding: [NSString defaultCStringEncoding]]; } #endif /* HAVE_SYS_UTSNAME_H */ From 977f07e7cd7d18910bb63290fa50c441339b6049 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 3 Oct 2006 14:49:01 +0000 Subject: [PATCH 030/266] handle recognition of solaris better. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23739 72102866-910b-0410-8b05-ffd578937521 --- Source/NSProcessInfo.m | 135 ++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 54 deletions(-) diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index fd77ca284..2d8705833 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -952,7 +952,8 @@ static void determineOperatingSystem() { if (_operatingSystem == 0) { - NSString *os = [NSBundle _gnustep_target_os]; + NSString *os = nil; + BOOL parseOS = YES; #if defined(__MINGW32__) OSVERSIONINFOW osver; @@ -978,6 +979,7 @@ static void determineOperatingSystem() if (uname(&uts) == 0) { os = [NSString stringWithCString: uts.sysname encoding: [NSString defaultCStringEncoding]]; + os = [os lowercaseString]; /* Get the operating system version ... usually the version string * is pretty horrible, and the kernel release string actually * makes more sense. @@ -985,6 +987,14 @@ static void determineOperatingSystem() _operatingSystemVersion = [[NSString alloc] initWithCString: uts.release encoding: [NSString defaultCStringEncoding]]; + + /* Hack for sunos/solaris ... sunos version 5 is solaris + */ + if ([os isEqualToString: @"sunos"] == YES + && [_operatingSystemVersion intValue] > 4) + { + os = @"solaris"; + } } #endif /* HAVE_SYS_UTSNAME_H */ #endif /* __MINGW32__ */ @@ -995,60 +1005,77 @@ static void determineOperatingSystem() _operatingSystemVersion = @"0.0"; } - if ([os hasPrefix: @"linux"] == YES) - { - _operatingSystemName = @"GSGNULinuxOperatingSystem"; - _operatingSystem = GSGNULinuxOperatingSystem; + while (parseOS == YES) + { + NSString *fallback = [NSBundle _gnustep_target_os]; + + if (os == nil) + { + os = fallback; + } + parseOS = NO; + + if ([os hasPrefix: @"linux"] == YES) + { + _operatingSystemName = @"GSGNULinuxOperatingSystem"; + _operatingSystem = GSGNULinuxOperatingSystem; + } + else if ([os hasPrefix: @"mingw"] == YES) + { + _operatingSystemName = @"NSWindowsNTOperatingSystem"; + _operatingSystem = NSWindowsNTOperatingSystem; + } + else if ([os isEqualToString: @"cygwin"] == YES) + { + _operatingSystemName = @"GSCygwinOperatingSystem"; + _operatingSystem = GSCygwinOperatingSystem; + } + else if ([os hasPrefix: @"bsd"] == YES + || [os hasPrefix: @"freebsd"] == YES + || [os hasPrefix: @"netbsd"] == YES + || [os hasPrefix: @"openbsd"] == YES) + { + _operatingSystemName = @"GSBSDOperatingSystem"; + _operatingSystem = GSBSDOperatingSystem; + } + else if ([os hasPrefix: @"beos"] == YES) + { + _operatingSystemName = @"GSBeOperatingSystem"; + _operatingSystem = GSBeOperatingSystem; + } + else if ([os hasPrefix: @"darwin"] == YES) + { + _operatingSystemName = @"NSMACHOperatingSystem"; + _operatingSystem = NSMACHOperatingSystem; + } + else if ([os hasPrefix: @"solaris"] == YES) + { + _operatingSystemName = @"NSSolarisOperatingSystem"; + _operatingSystem = NSSolarisOperatingSystem; + } + else if ([os hasPrefix: @"hpux"] == YES) + { + _operatingSystemName = @"NSHPUXOperatingSystem"; + _operatingSystem = NSHPUXOperatingSystem; + } + else if ([os hasPrefix: @"sunos"] == YES) + { + _operatingSystemName = @"NSSunOSOperatingSystem"; + _operatingSystem = NSSunOSOperatingSystem; + } + else if ([os hasPrefix: @"osf"] == YES) + { + _operatingSystemName = @"NSOSF1OperatingSystem"; + _operatingSystem = NSOSF1OperatingSystem; + } + if (_operatingSystem == 0 && [os isEqual: fallback] == NO) + { + os = fallback; + parseOS = YES; // Try again with fallback + } } - else if ([os hasPrefix: @"mingw"] == YES) - { - _operatingSystemName = @"NSWindowsNTOperatingSystem"; - _operatingSystem = NSWindowsNTOperatingSystem; - } - else if ([os isEqualToString: @"cygwin"] == YES) - { - _operatingSystemName = @"GSCygwinOperatingSystem"; - _operatingSystem = GSCygwinOperatingSystem; - } - else if ([os hasPrefix: @"bsd"] == YES - || [os hasPrefix: @"freebsd"] == YES - || [os hasPrefix: @"netbsd"] == YES - || [os hasPrefix: @"openbsd"] == YES) - { - _operatingSystemName = @"GSBSDOperatingSystem"; - _operatingSystem = GSBSDOperatingSystem; - } - else if ([os hasPrefix: @"beos"] == YES) - { - _operatingSystemName = @"GSBeOperatingSystem"; - _operatingSystem = GSBeOperatingSystem; - } - else if ([os hasPrefix: @"darwin"] == YES) - { - _operatingSystemName = @"NSMACHOperatingSystem"; - _operatingSystem = NSMACHOperatingSystem; - } - else if ([os hasPrefix: @"solaris"] == YES) - { - _operatingSystemName = @"NSSolarisOperatingSystem"; - _operatingSystem = NSSolarisOperatingSystem; - } - else if ([os hasPrefix: @"hpux"] == YES) - { - _operatingSystemName = @"NSHPUXOperatingSystem"; - _operatingSystem = NSHPUXOperatingSystem; - } - else if ([os hasPrefix: @"sunos"] == YES) - { - _operatingSystemName = @"NSSunOSOperatingSystem"; - _operatingSystem = NSSunOSOperatingSystem; - } - else if ([os hasPrefix: @"osf"] == YES) - { - _operatingSystemName = @"NSOSF1OperatingSystem"; - _operatingSystem = NSOSF1OperatingSystem; - } - else + + if (_operatingSystem == 0) { NSWarnFLog(@"Unable to determine O/S ... assuming GNU/Linux"); _operatingSystemName = @"GSGNULinuxOperatingSystem"; From 62d6638993b1916dfea187540cfc49eccfb5a0f8 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 4 Oct 2006 10:48:09 +0000 Subject: [PATCH 031/266] Improve argument checking git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23753 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 ++++++ Source/GSHTTPAuthentication.m | 12 +++++++--- Source/GSHTTPURLHandle.m | 45 ++++++++++++++++++++--------------- Source/NSHTTPCookieStorage.m | 2 ++ 4 files changed, 44 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index b826b4887..15d348824 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-10-04 Richard Frith-Macdonald + + * Source/GSHTTPURLHandle.m: + * Source/NSHTTPCookieStorage.m: + * Source/GSHTTPAuthentication.m: Add a little checking for nil/invalid + arguments. Make parsing of authentication a little more tolerant. + 2006-10-03 Richard Frith-Macdonald * Version: Bump to version for next release. diff --git a/Source/GSHTTPAuthentication.m b/Source/GSHTTPAuthentication.m index ba222fbb3..a1558b9ea 100644 --- a/Source/GSHTTPAuthentication.m +++ b/Source/GSHTTPAuthentication.m @@ -94,6 +94,11 @@ static GSMimeParser *mimeParser = nil; NSURLProtectionSpace *known = nil; GSHTTPAuthentication *authentication = nil; + NSAssert([credential isKindOfClass: [NSURLCredential class]] == YES, + NSInvalidArgumentException); + NSAssert([space isKindOfClass: [NSURLProtectionSpace class]] == YES, + NSInvalidArgumentException); + [storeLock lock]; /* @@ -146,18 +151,19 @@ static GSMimeParser *mimeParser = nil; space = [self protectionSpaceForURL: URL]; sc = [NSScanner scannerWithString: auth]; - if ([sc scanString: @"Basic" intoString: 0] == YES) + key = [mimeParser scanName: sc]; + if ([key caseInsensitiveCompare: @"Basic"] == NSOrderedSame) { method = NSURLAuthenticationMethodHTTPBasic; domain = [URL path]; } - else if ([sc scanString: @"Digest" intoString: 0] == YES) + else if ([key caseInsensitiveCompare: @"Digest"] == NSOrderedSame) { method = NSURLAuthenticationMethodHTTPDigest; } else { - return nil; // Not a known authentication + return nil; // Unknown authentication } while ((key = [mimeParser scanName: sc]) != nil) { diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index 23440132b..2a6aa47ca 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -613,7 +613,6 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) { NSURLProtectionSpace *space; NSString *ac; - NSURLCredential *cred; GSHTTPAuthentication *authentication; NSString *method; NSString *a; @@ -621,25 +620,33 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) ac = [ah value]; space = [GSHTTPAuthentication protectionSpaceForAuthentication: ac requestURL: url]; + if (space != nil) + { + NSURLCredential *cred; - /* - * Create credential from user and password - * stored in the URL. - */ - cred = [[NSURLCredential alloc] - initWithUser: [url user] - password: [url password] - persistence: NSURLCredentialPersistenceForSession]; + /* + * Create credential from user and password + * stored in the URL. + */ + cred = [[NSURLCredential alloc] + initWithUser: [url user] + password: [url password] + persistence: NSURLCredentialPersistenceForSession]; - /* - * Get the digest object and ask it for a header - * to use for authorisation. - */ - authentication = [GSHTTPAuthentication - authenticationWithCredential: cred - inProtectionSpace: space]; + /* + * Get the digest object and ask it for a header + * to use for authorisation. + */ + authentication = [GSHTTPAuthentication + authenticationWithCredential: cred + inProtectionSpace: space]; - RELEASE(cred); + RELEASE(cred); + } + else + { + authentication = nil; + } method = [request objectForKey: GSHTTPPropertyMethodKey]; if (method == nil) @@ -655,8 +662,8 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) } a = [authentication authorizationForAuthentication: ac - method: method - path: [url path]]; + method: method + path: [url path]]; if (a != nil) { [self writeProperty: a forKey: @"Authorization"]; diff --git a/Source/NSHTTPCookieStorage.m b/Source/NSHTTPCookieStorage.m index 7a13e52f3..c5c991d51 100644 --- a/Source/NSHTTPCookieStorage.m +++ b/Source/NSHTTPCookieStorage.m @@ -111,6 +111,8 @@ static NSHTTPCookieStorage *storage = nil; - (void) setCookie: (NSHTTPCookie *)cookie { + NSAssert([cookie isKindOfClass: [NSHTTPCookie class]] == YES, + NSInvalidArgumentException); [this->_cookies addObject: cookie]; } From a03a91b1ece8f54a58c34c08e35a00c63b80e172 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 5 Oct 2006 18:28:32 +0000 Subject: [PATCH 032/266] Add a couple more charset mappings git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23767 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/Additions/GSMime.m | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 15d348824..a831d4c41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-10-05 Richard Frith-Macdonald + + * Source/Additions/GSMime.m: Add a couple more charset mappings. + 2006-10-04 Richard Frith-Macdonald * Source/GSHTTPURLHandle.m: diff --git a/Source/Additions/GSMime.m b/Source/Additions/GSMime.m index 73db2f33d..3896cad86 100644 --- a/Source/Additions/GSMime.m +++ b/Source/Additions/GSMime.m @@ -3658,6 +3658,12 @@ static NSCharacterSet *tokenSet = nil; NSMapInsert(charsets, (void*)@"csisolatin1", (void*)NSISOLatin1StringEncoding); + // A couple of telecoms charsets + NSMapInsert(charsets, (void*)@"ia5", + (void*)NSASCIIStringEncoding); + NSMapInsert(charsets, (void*)@"gsm0338", + (void*)NSGSM0338StringEncoding); + NSMapInsert(charsets, (void*)@"iso-8859-2", (void*)NSISOLatin2StringEncoding); NSMapInsert(charsets, (void*)@"iso-8859-3", @@ -3767,6 +3773,8 @@ static NSCharacterSet *tokenSet = nil; (void*)@"utf-7"); NSMapInsert(encodings, (void*)NSUTF8StringEncoding, (void*)@"utf-8"); + NSMapInsert(charsets, (void*)NSGSM0338StringEncoding, + (void*)@"gsm0338"); } } } From 183a5c2c874174f6221d332ffa8b1598ad6267fb Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 5 Oct 2006 19:27:15 +0000 Subject: [PATCH 033/266] Cleanup to get rid of a few global variables git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23768 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/GSHTTPURLHandle.m | 2 +- Source/NSBundle.m | 2 +- Source/NSPort.m | 7 ++++--- Source/NSRunLoop.m | 11 ----------- Source/unix/GSRunLoopCtxt.m | 19 +++++++++++++++---- Source/win32/GSRunLoopCtxt.m | 19 +++++++++++++++---- 7 files changed, 41 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index a831d4c41..5682bcc78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 2006-10-05 Richard Frith-Macdonald * Source/Additions/GSMime.m: Add a couple more charset mappings. + * Source/NSRunLoop.m: Move some variables to GSRunLoopCtxt.m + * Source/GSHTTPURLHandle.m: Make a global static + * Source/NSPort.m: Make two globals static + * Source/unix/GSRunLoopCtxt.m: Make variable static. + * Source/win32/GSRunLoopCtxt.m: Make variable static. 2006-10-04 Richard Frith-Macdonald diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index 2a6aa47ca..b69ac8518 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -81,7 +81,7 @@ typedef void (*NSMT_retain_func_t)(NSMapTable *, const void *); typedef void (*NSMT_release_func_t)(NSMapTable *, void *); typedef NSString *(*NSMT_describe_func_t)(NSMapTable *, const void *); -const NSMapTableKeyCallBacks writeKeyCallBacks = +static const NSMapTableKeyCallBacks writeKeyCallBacks = { (NSMT_hash_func_t) _non_retained_id_hash, (NSMT_is_equal_func_t) _non_retained_id_is_equal, diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 0546aed75..4373e495e 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -669,7 +669,7 @@ typedef struct { @defs(NSBundle) } *bptr; -void +static void _bundle_load_callback(Class theClass, struct objc_category *theCategory) { NSCAssert(_loadingBundle, NSInternalInconsistencyException); diff --git a/Source/NSPort.m b/Source/NSPort.m index eea40bef1..8d949a1b2 100644 --- a/Source/NSPort.m +++ b/Source/NSPort.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSPort class reference $Date$ $Revision$ @@ -53,8 +54,8 @@ */ NSString * const NSPortTimeoutException = @"NSPortTimeoutException"; -Class NSPort_abstract_class; -Class NSPort_concrete_class; +static Class NSPort_abstract_class; +static Class NSPort_concrete_class; + (id) allocWithZone: (NSZone*)aZone { diff --git a/Source/NSRunLoop.m b/Source/NSRunLoop.m index 5e7af174f..9638163dc 100644 --- a/Source/NSRunLoop.m +++ b/Source/NSRunLoop.m @@ -632,11 +632,6 @@ static NSComparisonResult tSort(GSIArrayItem i0, GSIArrayItem i1) @end -extern SEL wRelSel; -extern SEL wRetSel; -extern IMP wRelImp; -extern IMP wRetImp; - /** *

NSRunLoop instances handle various utility tasks that must * be performed repetitively in an application, such as processing input @@ -662,12 +657,6 @@ extern IMP wRetImp; { [self currentRunLoop]; theFuture = RETAIN([NSDate distantFuture]); -#if GS_WITH_GC == 0 - wRelSel = @selector(release); - wRetSel = @selector(retain); - wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel]; - wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel]; -#endif } } diff --git a/Source/unix/GSRunLoopCtxt.m b/Source/unix/GSRunLoopCtxt.m index 11ad51221..aebf55267 100644 --- a/Source/unix/GSRunLoopCtxt.m +++ b/Source/unix/GSRunLoopCtxt.m @@ -33,10 +33,10 @@ extern BOOL GSCheckTasks(); #if GS_WITH_GC == 0 -SEL wRelSel; -SEL wRetSel; -IMP wRelImp; -IMP wRetImp; +static SEL wRelSel; +static SEL wRetSel; +static IMP wRelImp; +static IMP wRetImp; static void wRelease(NSMapTable* t, void* w) @@ -61,6 +61,17 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = #endif @implementation GSRunLoopCtxt + ++ (void) initialize +{ +#if GS_WITH_GC == 0 + wRelSel = @selector(release); + wRetSel = @selector(retain); + wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel]; + wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel]; +#endif +} + - (void) dealloc { RELEASE(mode); diff --git a/Source/win32/GSRunLoopCtxt.m b/Source/win32/GSRunLoopCtxt.m index 0056115a9..9eebff4bb 100644 --- a/Source/win32/GSRunLoopCtxt.m +++ b/Source/win32/GSRunLoopCtxt.m @@ -20,10 +20,10 @@ extern BOOL GSCheckTasks(); #if GS_WITH_GC == 0 -SEL wRelSel; -SEL wRetSel; -IMP wRelImp; -IMP wRetImp; +static SEL wRelSel; +static SEL wRetSel; +static IMP wRelImp; +static IMP wRetImp; static void wRelease(NSMapTable* t, void* w) @@ -48,6 +48,17 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = #endif @implementation GSRunLoopCtxt + ++ (void) initialize +{ +#if GS_WITH_GC == 0 + wRelSel = @selector(release); + wRetSel = @selector(retain); + wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel]; + wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel]; +#endif +} + - (void) dealloc { RELEASE(mode); From c35eeefbeb26d1ce7cf852922c9dc92ec48c444f Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Thu, 5 Oct 2006 22:40:18 +0000 Subject: [PATCH 034/266] Corrected bug in last change that prevented all GNUstep programs from running. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23769 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/Additions/GSMime.m | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5682bcc78..79a43e431 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-06 Fred Kiefer + + * Source/Additions/GSMime.m(GSMimeDocument +initialize): Corrected + small bug in last patch. + 2006-10-05 Richard Frith-Macdonald * Source/Additions/GSMime.m: Add a couple more charset mappings. diff --git a/Source/Additions/GSMime.m b/Source/Additions/GSMime.m index 3896cad86..29bceaee4 100644 --- a/Source/Additions/GSMime.m +++ b/Source/Additions/GSMime.m @@ -3773,7 +3773,7 @@ static NSCharacterSet *tokenSet = nil; (void*)@"utf-7"); NSMapInsert(encodings, (void*)NSUTF8StringEncoding, (void*)@"utf-8"); - NSMapInsert(charsets, (void*)NSGSM0338StringEncoding, + NSMapInsert(encodings, (void*)NSGSM0338StringEncoding, (void*)@"gsm0338"); } } From 9d71af9cbfe8c7dd323122e8e77c3fd237d2e5a9 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 6 Oct 2006 19:14:22 +0000 Subject: [PATCH 035/266] Update testsuite location git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23780 72102866-910b-0410-8b05-ffd578937521 --- Testing/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Testing/README b/Testing/README index 772f8a8fb..622458e14 100644 --- a/Testing/README +++ b/Testing/README @@ -4,7 +4,7 @@ to do quick checks to make sure things are working. This is not a comprehensive test suite. Some tests don't say if they have passed or not. Some tests do not even output anything. Some tests never quit! -If you want to run a comprehensive testsuite. Install gnustep-guile -(ftp://ftp.gnustep.org/pub/gnustep/libs) and run the gnustep testsuite -(ftp://ftp.gnustep.org/pub/gnustep/tests). +If you want to run a comprehensive testsuite, run the gnustep testsuite +http://svn.gna.org/viewcvs/gnustep/tests/testsuite +(also ftp://ftp.gnustep.org/pub/gnustep/test). From eae859d1c71580a5d2132d92815cacf6d4d6afbb Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 9 Oct 2006 14:00:01 +0000 Subject: [PATCH 036/266] Updates to reduce global namespace pollution. Plenty more remaining. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23795 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 86 +++ Headers/Additions/GNUstepBase/GSFunctions.h | 2 + Headers/Additions/GNUstepBase/GSObjCRuntime.h | 8 +- Headers/Additions/GNUstepBase/Unicode.h | 24 +- Headers/Foundation/NSException.h | 6 +- SSL/GSSSLHandle.m | 8 +- Source/Additions/GSCategories.m | 47 ++ Source/Additions/GSCompatibility.m | 15 +- Source/Additions/GSFunctions.m | 2 + Source/Additions/GSXML.m | 10 +- Source/Additions/Unicode.m | 604 ++++++++---------- .../Additions}/unicode/caseconv.h | 306 +-------- .../Additions}/unicode/cop.h | 4 +- .../Additions}/unicode/cyrillic.h | 10 +- .../Additions}/unicode/decomp.h | 4 +- .../Additions}/unicode/gsm0338.h | 11 +- .../Additions}/unicode/latin2.h | 10 +- .../Additions}/unicode/latin9.h | 10 +- .../Additions}/unicode/nextstep.h | 9 +- .../Additions}/unicode/thai.h | 10 +- Source/GNUmakefile | 11 +- Source/GSCompatibility.m | 11 +- Source/GSFFCallInvocation.m | 4 +- Source/GSFTPURLHandle.m | 10 +- Source/GSFileHandle.m | 85 +-- Source/GSFormat.m | 16 +- Source/GSHTTPURLHandle.m | 5 +- Source/GSLocale.m | 19 +- Source/GSPrivate.h | 99 ++- Source/GSStream.m | 3 +- Source/GSString.m | 82 +-- Source/NSArchiver.m | 2 +- Source/NSArray.m | 4 +- Source/NSBundle.m | 29 +- Source/NSCalendarDate.m | 8 +- Source/NSData.m | 143 ++--- Source/NSDate.m | 2 +- Source/NSDateFormatter.m | 3 +- Source/NSDebug.m | 3 +- Source/NSDecimal.m | 3 +- Source/NSDecimalNumber.m | 5 +- Source/NSDictionary.m | 4 +- Source/NSDistributedLock.m | 16 +- Source/NSException.m | 13 +- Source/NSFileManager.m | 50 +- Source/NSHost.m | 6 +- Source/NSInvocation.m | 12 +- Source/NSKeyedArchiver.m | 2 +- Source/NSLog.m | 10 +- Source/NSMessagePort.m | 48 +- Source/NSObjCRuntime.m | 7 +- Source/NSObject.m | 12 +- Source/NSPathUtilities.m | 4 +- Source/NSPipe.m | 11 +- Source/NSProcessInfo.m | 28 +- Source/NSPropertyList.m | 2 +- Source/NSScanner.m | 6 +- Source/NSSocketPort.m | 52 +- Source/NSSocketPortNameServer.m | 6 +- Source/NSString.m | 15 +- Source/NSTask.m | 9 +- Source/NSThread.m | 9 +- Source/NSTimeZone.m | 2 +- Source/NSUserDefaults.m | 12 +- Source/objc-load.m | 2 +- Source/unix/GSRunLoopCtxt.m | 8 +- Source/win32/GSFileHandleWin32.m | 93 +-- Source/win32/GSRunLoopCtxt.m | 6 +- Source/win32/NSMessagePortNameServerWin32.m | 4 +- Source/win32/NSMessagePortWin32.m | 35 +- Source/win32/NSStreamWin32.m | 6 +- Source/win32/NSUserDefaultsWin32.m | 94 +-- Testing/benchmark.m | 8 +- Testing/call.m | 4 +- Testing/exported-strings.m | 2 +- Testing/nsconnection_server.m | 2 +- Testing/tcpport-client.m | 2 +- Testing/tcpport-server.m | 2 +- Tools/AGSParser.m | 4 +- Tools/Makefile.preamble | 3 +- Tools/defaults.m | 4 +- Tools/locale_alias.m | 8 +- Tools/make_strings/make_strings.m | 7 +- Tools/pl.m | 2 +- Tools/xmlparse.m | 2 +- 85 files changed, 1090 insertions(+), 1277 deletions(-) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/caseconv.h (98%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/cop.h (98%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/cyrillic.h (94%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/decomp.h (99%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/gsm0338.h (96%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/latin2.h (95%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/latin9.h (95%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/nextstep.h (94%) rename {Headers/Additions/GNUstepBase => Source/Additions}/unicode/thai.h (93%) diff --git a/ChangeLog b/ChangeLog index 79a43e431..3f0619855 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,89 @@ +2006-10-09 Richard Frith-Macdonald + + * Headers/Additions/GNUstepBase/unicode: + Moved to Source/Additions/unicode + * Source/NSSocketPortNameServer.m: + * Source/GSLocale.m: + * Source/NSTimeZone.m: + * Source/GSCompatibility.m: + * Source/NSCalendarDate.m: + * Source/NSBundle.m: + * Source/NSPropertyList.m: + * Source/NSPathUtilities.m: + * Source/NSScanner.m: + * Source/NSProcessInfo.m: + * Source/GNUmakefile: + * Source/NSSocketPort.m: + * Source/NSUserDefaults.m: + * Source/GSFFCallInvocation.m: + * Source/NSArray.m: + * Source/GSStream.m: + * Source/NSKeyedArchiver.m: + * Source/NSDebug.m: + * Source/unix/GSRunLoopCtxt.m: + * Source/NSDistributedLock.m: + * Source/GSHTTPURLHandle.m: + * Source/NSMessagePort.m: + * Source/GSPrivate.h: + * Source/win32/NSMessagePortNameServerWin32.m: + * Source/win32/GSFileHandleWin32.m: + * Source/win32/NSUserDefaultsWin32.m: + * Source/win32/GSRunLoopCtxt.m: + * Source/win32/NSMessagePortWin32.m: + * Source/win32/NSStreamWin32.m: + * Source/NSInvocation.m: + * Source/NSFileManager.m: + * Source/objc-load.m: + * Source/NSException.m: + * Source/NSString.m: + * Source/NSObject.m: + * Source/NSDecimalNumber.m: + * Source/Additions/Unicode.m: + * Source/Additions/GSXML.m: + * Source/Additions/GSFunctions.m: + * Source/Additions/GSCompatibility.m: + * Source/Additions/GSCategories.m: + * Source/NSDecimal.m: + * Source/GSString.m: + * Source/NSDateFormatter.m: + * Source/NSThread.m: + * Source/NSData.m: + * Source/NSHost.m: + * Source/NSDate.m: + * Source/NSObjCRuntime.m: + * Source/NSPipe.m: + * Source/NSDictionary.m: + * Source/NSLog.m: + * Source/GSFormat.m: + * Source/GSFileHandle.m: + * Source/NSTask.m: + * Source/NSArchiver.m: + * Source/GSFTPURLHandle.m: + * SSL/GSSSLHandle.m: + * Headers/Foundation/NSException.h: + * Headers/Additions/GNUstepBase/GSFunctions.h: + * Headers/Additions/GNUstepBase/GSObjCRuntime.h: + * Headers/Additions/GNUstepBase/Unicode.h: + * Tools/xmlparse.m: + * Tools/defaults.m: + * Tools/locale_alias.m: + * Tools/Makefile.preamble: + * Tools/AGSParser.m: + * Tools/make_strings/make_strings.m: + * Tools/pl.m: + * Testing/tcpport-server.m: + * Testing/exported-strings.m: + * Testing/call.m: + * Testing/nsconnection_server.m: + * Testing/benchmark.m: + * Testing/tcpport-client.m: + Continuing effort to reduce global namespace pollution ... made many + external variables static (particuarly unicode tables). Changed + several global functions to be methods of a private internal class. + Also updated several usages of deprecated cString methods to use + either UTF8 methods or cString...encoding methods as seemed most + appropriate and/or simplest. + 2006-10-06 Fred Kiefer * Source/Additions/GSMime.m(GSMimeDocument +initialize): Corrected diff --git a/Headers/Additions/GNUstepBase/GSFunctions.h b/Headers/Additions/GNUstepBase/GSFunctions.h index 22d916b58..c1f073ff4 100644 --- a/Headers/Additions/GNUstepBase/GSFunctions.h +++ b/Headers/Additions/GNUstepBase/GSFunctions.h @@ -31,6 +31,8 @@ #include "GNUstepBase/GSObjCRuntime.h" #include "GNUstepBase/GNUstep.h" +#warning "deprecated header ... will be removed in a later release" + #if defined(__cplusplus) extern "C" { #endif diff --git a/Headers/Additions/GNUstepBase/GSObjCRuntime.h b/Headers/Additions/GNUstepBase/GSObjCRuntime.h index 60b089bdf..57f67ed5a 100644 --- a/Headers/Additions/GNUstepBase/GSObjCRuntime.h +++ b/Headers/Additions/GNUstepBase/GSObjCRuntime.h @@ -673,11 +673,6 @@ GSAutoreleasedBuffer(unsigned size); GS_EXPORT void GSAllocateMutexAt(objc_mutex_t *request); -/** Returns a system error message on a variety of systems - */ -GS_EXPORT const char * -GSLastErrorStr(long error_id); - /** *

Prints a message to fptr using the format string provided and any * additional arguments. The format string is interpreted as by @@ -699,6 +694,9 @@ GSPrintf (FILE *fptr, NSString *format, ...); #ifndef NO_DEPRECATED +GS_EXPORT const char * +GSLastErrorStr(long error_id) GS_ATTRIB_DEPRECATED; + GS_EXPORT BOOL GSFindInstanceVariable(id obj, const char *name, const char **type, diff --git a/Headers/Additions/GNUstepBase/Unicode.h b/Headers/Additions/GNUstepBase/Unicode.h index aab11f7ed..95cc6a99d 100644 --- a/Headers/Additions/GNUstepBase/Unicode.h +++ b/Headers/Additions/GNUstepBase/Unicode.h @@ -44,19 +44,17 @@ extern "C" { #endif - -GS_EXPORT NSStringEncoding *GetAvailableEncodings(void); -GS_EXPORT NSStringEncoding GetDefEncoding(void); +#if GS_API_VERSION(GS_API_NONE,011500) +/* Deprecated functions */ GS_EXPORT NSStringEncoding GSEncodingFromLocale(const char *clocale); GS_EXPORT NSStringEncoding GSEncodingForRegistry(NSString *registry, NSString *encoding); -GS_EXPORT NSString* GSEncodingName(NSStringEncoding encoding); - GS_EXPORT unichar uni_tolower(unichar ch); GS_EXPORT unichar uni_toupper(unichar ch); GS_EXPORT unsigned char uni_cop(unichar u); GS_EXPORT BOOL uni_isnonsp(unichar u); GS_EXPORT unichar *uni_is_decomp(unichar u); +#endif /* @@ -77,22 +75,6 @@ GS_EXPORT BOOL GSToUnicode(unichar **dst, unsigned int *size, const unsigned char *src, unsigned int slen, NSStringEncoding enc, NSZone *zone, unsigned int options); -/* - * The next functions are deprecated and will be removed in a future - * release. Use GSFromUnicode() and GSToUnicode() instead. - */ -GS_EXPORT NSString* GetEncodingName(NSStringEncoding encoding); -GS_EXPORT unichar chartouni(unsigned char c); -GS_EXPORT unsigned char unitochar(unichar u); -GS_EXPORT unichar encode_chartouni(unsigned char c, NSStringEncoding enc); -GS_EXPORT unsigned char encode_unitochar(unichar u, NSStringEncoding enc); -GS_EXPORT unsigned encode_unitochar_strict(unichar u, NSStringEncoding enc); -GS_EXPORT int encode_ustrtocstr(char *dst, int dl, const unichar *src, int sl, - NSStringEncoding enc, BOOL strict); -GS_EXPORT int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl, - NSStringEncoding enc); - - #if defined(__cplusplus) } #endif diff --git a/Headers/Foundation/NSException.h b/Headers/Foundation/NSException.h index d2cba3c2a..3e312e0c4 100644 --- a/Headers/Foundation/NSException.h +++ b/Headers/Foundation/NSException.h @@ -335,7 +335,7 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler ); [[NSAssertionHandler currentHandler] \ handleFailureInMethod: _cmd \ object: self \ - file: [NSString stringWithCString: __FILE__] \ + file: [NSString stringWithUTF8String: __FILE__] \ lineNumber: __LINE__ \ description: (desc) , ## args]; \ } \ @@ -345,8 +345,8 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler ); do { \ if (!(condition)) { \ [[NSAssertionHandler currentHandler] \ - handleFailureInFunction: [NSString stringWithCString: __PRETTY_FUNCTION__] \ - file: [NSString stringWithCString: __FILE__] \ + handleFailureInFunction: [NSString stringWithUTF8String: __PRETTY_FUNCTION__] \ + file: [NSString stringWithUTF8String: __FILE__] \ lineNumber: __LINE__ \ description: (desc) , ## args]; \ } \ diff --git a/SSL/GSSSLHandle.m b/SSL/GSSSLHandle.m index 856de0af8..ccd9bf989 100644 --- a/SSL/GSSSLHandle.m +++ b/SSL/GSSSLHandle.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ @@ -53,6 +54,7 @@ #include #include +#include "GSPrivate.h" #if defined(__MINGW32__) #include @@ -105,8 +107,8 @@ sslError(int err, int e) str = @"Want X509 Lookup Error"; break; case SSL_ERROR_SYSCALL: - str = [NSString stringWithFormat: @"Syscall error %d - %s", - e, GSLastErrorStr(e)]; + str = [NSString stringWithFormat: @"Syscall error %d - %@", + e, [_GSPrivate error: e]]; break; case SSL_ERROR_SSL: str = @"SSL Error: really helpful"; diff --git a/Source/Additions/GSCategories.m b/Source/Additions/GSCategories.m index a2e551517..31b27dfaf 100644 --- a/Source/Additions/GSCategories.m +++ b/Source/Additions/GSCategories.m @@ -27,10 +27,57 @@ #include #include "GNUstepBase/GSCategories.h" #include "GNUstepBase/GSLock.h" +#include "GSPrivate.h" /* Test for ASCII whitespace which is safe for unicode characters */ #define space(C) ((C) > 127 ? NO : isspace(C)) +#ifndef HAVE_STRERROR +const char * +strerror(int eno) +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + if (eno < 0 || eno >= sys_nerr) + { + return("unknown error number"); + } + return(sys_errlist[eno]); +} +#endif + +@implementation _GSPrivate + ++ (NSString*) error +{ +#if defined(__MINGW32__) + return [self error: GetLastError()]; +#else + extern int errno; + return [self error: errno]; +#endif +} + ++ (NSString*) error: (long)number +{ + NSString *text; +#if defined(__MINGW32__) + LPVOID lpMsgBuf; + + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, nuymber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR) &lpMsgBuf, 0, NULL ); + text = [NSString stringWithCharacters: lpMsgBuf length: wcslen(lpMsgBuf)]; + LocalFree(lpMsgBuf); +#else + text = [NSString stringWithCString: strerror(number) + encoding: [NSString defaultCStringEncoding]]; +#endif + return text; +} +@end + @implementation NSArray (GSCategories) - (unsigned) insertionPosition: (id)item diff --git a/Source/Additions/GSCompatibility.m b/Source/Additions/GSCompatibility.m index ac52fb382..566b34d0e 100644 --- a/Source/Additions/GSCompatibility.m +++ b/Source/Additions/GSCompatibility.m @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "config.h" @@ -260,7 +261,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) < 0) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); RELEASE(self); return nil; } @@ -277,8 +278,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr), - NSSwapBigShortToHost(sin.sin_port), GSLastErrorStr(errno)); + NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr), + NSSwapBigShortToHost(sin.sin_port), [_GSPrivate error]); (void) close(net); RELEASE(self); return nil; @@ -286,7 +287,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) if (listen(net, 5) < 0) { - NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno)); + NSLog(@"unable to listen on port - %@", [_GSPrivate error]); (void) close(net); RELEASE(self); return nil; @@ -294,7 +295,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) if (getsockname(net, (struct sockaddr*)&sin, &size) < 0) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); (void) close(net); RELEASE(self); return nil; @@ -323,7 +324,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) if (getsockname([self fileDescriptor], (struct sockaddr*)&sin, &size) < 0) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); return nil; } diff --git a/Source/Additions/GSFunctions.m b/Source/Additions/GSFunctions.m index 169ede7bd..ff9218624 100644 --- a/Source/Additions/GSFunctions.m +++ b/Source/Additions/GSFunctions.m @@ -40,6 +40,8 @@ GSFindNamedFile(NSArray *paths, NSString *aName, NSString *anExtension) NSCParameterAssert(aName != nil); NSCParameterAssert(paths != nil); +GSOnceFLog(@"deprecated ... trivial to code directly"); + /* make up the name with extension if given */ if (anExtension != nil) { diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index fd6d39d83..32d2dba45 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -122,14 +122,12 @@ UTF8Str(const unsigned char *bytes) inline static NSString* UTF8StrLen(const unsigned char *bytes, unsigned length) { - unsigned char *buf = NSZoneMalloc(NSDefaultMallocZone(), length+1); NSString *str; - memcpy(buf, bytes, length); - buf[length] = '\0'; - str = UTF8Str(buf); - NSZoneFree(NSDefaultMallocZone(), buf); - return str; + str = [[NSString_class alloc] initWithBytes: bytes + length: length + encoding: NSUTF8StringEncoding]; + return AUTORELEASE(str); } static BOOL cacheDone = NO; diff --git a/Source/Additions/Unicode.m b/Source/Additions/Unicode.m index 8ca2f9190..902b614e9 100644 --- a/Source/Additions/Unicode.m +++ b/Source/Additions/Unicode.m @@ -24,7 +24,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "config.h" @@ -42,6 +43,7 @@ #include "GNUstepBase/GSLock.h" #include "GNUstepBase/GSCategories.h" #include "GNUstepBase/Unicode.h" +#include "../GSPrivate.h" #include #include #include @@ -52,15 +54,15 @@ typedef struct {unichar from; unsigned char to;} _ucc_; -#include "GNUstepBase/unicode/cyrillic.h" -#include "GNUstepBase/unicode/latin2.h" -#include "GNUstepBase/unicode/latin9.h" -#include "GNUstepBase/unicode/nextstep.h" -#include "GNUstepBase/unicode/caseconv.h" -#include "GNUstepBase/unicode/cop.h" -#include "GNUstepBase/unicode/decomp.h" -#include "GNUstepBase/unicode/gsm0338.h" -#include "GNUstepBase/unicode/thai.h" +#include "unicode/cyrillic.h" +#include "unicode/latin2.h" +#include "unicode/latin9.h" +#include "unicode/nextstep.h" +#include "unicode/caseconv.h" +#include "unicode/cop.h" +#include "unicode/decomp.h" +#include "unicode/gsm0338.h" +#include "unicode/thai.h" #ifdef HAVE_ICONV #ifdef HAVE_GICONV_H @@ -329,7 +331,7 @@ static void GSSetupEncodingTable(void) } } -BOOL GSEncodingSupported(NSStringEncoding enc) +static BOOL isEncodingSupported(NSStringEncoding enc) { GSSetupEncodingTable(); @@ -385,9 +387,6 @@ BOOL GSEncodingSupported(NSStringEncoding enc) return NO; } -/** - * Returns a nul terminated array of the available string encodings. - */ NSStringEncoding * GetAvailableEncodings() { @@ -412,7 +411,7 @@ GetAvailableEncodings() pos = 0; for (i = 0; i < encTableSize+1; i++) { - if (GSEncodingSupported(i) == YES) + if (isEncodingSupported(i) == YES) { encodings[pos++] = i; } @@ -532,7 +531,7 @@ GSEncodingForRegistry (NSString *registry, NSString *encoding) * deduced from the clocale string itself. If clocale isn't set or * no match can be found, returns GSUndefinedEncoding. */ -/* It would be really nice if this could be used in GetDefEncoding, but +/* It would be really nice if this could be used in +defaultCStringEncoding, but * there are too many dependancies on other parts of the library to * make this practical (even if everything possible was written in C, * we'd still need some way to find the Locale.encodings file). @@ -559,7 +558,7 @@ GSEncodingFromLocale(const char *clocale) char *s; s = strchr (clocale, '.'); - registry = [[NSString stringWithCString: s+1] lowercaseString]; + registry = [[NSString stringWithUTF8String: s+1] lowercaseString]; array = [registry componentsSeparatedByString: @"-"]; registry = [array objectAtIndex: 0]; if ([array count] > 1) @@ -594,7 +593,7 @@ GSEncodingFromLocale(const char *clocale) dict = [NSDictionary dictionaryWithContentsOfFile: table]; encodstr = [dict objectForKey: - [NSString stringWithCString: clocale]]; + [NSString stringWithUTF8String: clocale]]; if (encodstr == nil) return GSUndefinedEncoding; @@ -620,299 +619,6 @@ GSEncodingFromLocale(const char *clocale) return encoding; } -/** - * Return the default encoding - */ -NSStringEncoding -GetDefEncoding(void) -{ - if (defEnc == GSUndefinedEncoding) - { - char *encoding; - unsigned int count; - - GSSetupEncodingTable(); - - [GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock]; - if (defEnc != GSUndefinedEncoding) - { - [local_lock unlock]; - return defEnc; - } - - encoding = getenv("GNUSTEP_STRING_ENCODING"); - if (encoding != 0) - { - count = 0; - while (str_encoding_table[count].enc - && strcasecmp(str_encoding_table[count].ename, encoding) - && strcasecmp(str_encoding_table[count].iconv, encoding)) - { - count++; - } - if (str_encoding_table[count].enc) - { - defEnc = str_encoding_table[count].enc; - } - else - { - fprintf(stderr, - "WARNING: %s - encoding not supported.\n", encoding); - fprintf(stderr, - " NSISOLatin1StringEncoding set as default.\n"); - defEnc = NSISOLatin1StringEncoding; - } - } - if (defEnc == GSUndefinedEncoding) - { - /* Encoding not set */ -#if HAVE_LANGINFO_CODESET - /* Take it from the system locale information. */ - encoding = nl_langinfo(CODESET); -/* - * First handle the fallback response from nl_langinfo() ... - * if we are getting the default value we can't assume that - * the user has set anything up at all, so we must use the - * OpenStep/GNUstep default encopding ... latin1, even though - * the nl_langinfo() stuff would say default is ascii. - */ - if (strcmp(encoding, "ANSI_X3.4-1968") == 0 /* glibc */ - || strcmp(encoding, "ISO_646.IRV:1983") == 0 /* glibc */ - || strcmp(encoding, "646") == 0 /* Solaris NetBSD */) - defEnc = NSISOLatin1StringEncoding; - else if (strcmp(encoding, "EUC-JP") == 0 /* glibc */ - /* HP-UX IRIX OSF/1 Solaris NetBSD */ - || strcmp(encoding, "eucJP") == 0 - || strcmp(encoding, "IBM-eucJP") == 0 /* AIX */) - defEnc = NSJapaneseEUCStringEncoding; - else if (strcmp(encoding, "UTF-8") == 0 /* glibc AIX OSF/1 Solaris */ - || strcmp(encoding, "utf8") == 0 /* HP-UX */) - defEnc = NSUTF8StringEncoding; - else if (strcmp(encoding, "ISO-8859-1") == 0 /* glibc */ - /* AIX IRIX OSF/1 Solaris NetBSD */ - || strcmp(encoding, "ISO8859-1") == 0 - || strcmp(encoding, "iso88591") == 0 /* HP-UX */) - defEnc = NSISOLatin1StringEncoding; - else if (strcmp(encoding, "IBM-932") == 0 /* AIX */ - || strcmp(encoding, "SJIS") == 0 /* HP-UX OSF/1 NetBSD */ - || strcmp(encoding, "PCK") == 0 /* Solaris */) - defEnc = NSShiftJISStringEncoding; - else if (strcmp(encoding, "ISO-8859-2") == 0 /* glibc */ - /* AIX IRIX OSF/1 Solaris NetBSD */ - || strcmp(encoding, "ISO8859-2") == 0 - || strcmp(encoding, "iso88592") == 0 /* HP-UX */) - defEnc = NSISOLatin2StringEncoding; - else if (strcmp(encoding, "CP1251") == 0 /* glibc */ - || strcmp(encoding, "ansi-1251") == 0 /* Solaris */) - defEnc = NSWindowsCP1251StringEncoding; - else if (strcmp(encoding, "CP1252") == 0 /* */ - || strcmp(encoding, "IBM-1252") == 0 /* AIX */) - defEnc = NSWindowsCP1252StringEncoding; - else if (strcmp(encoding, "ISO-8859-5") == 0 /* glibc */ - /* AIX IRIX OSF/1 Solaris NetBSD */ - || strcmp(encoding, "ISO8859-5") == 0 - || strcmp(encoding, "iso88595") == 0 /* HP-UX */) - defEnc = NSISOCyrillicStringEncoding; - else if (strcmp(encoding, "KOI8-R") == 0 /* glibc */ - || strcmp(encoding, "koi8-r") == 0 /* Solaris */) - defEnc = NSKOI8RStringEncoding; - else if (strcmp(encoding, "ISO-8859-3") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-3") == 0 /* Solaris */) - defEnc = NSISOLatin3StringEncoding; - else if (strcmp(encoding, "ISO-8859-4") == 0 /* */ - || strcmp(encoding, "ISO8859-4") == 0 /* OSF/1 Solaris NetBSD */) - defEnc = NSISOLatin4StringEncoding; - else if (strcmp(encoding, "ISO-8859-6") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-6") == 0 /* AIX Solaris */ - || strcmp(encoding, "iso88596") == 0 /* HP-UX */) - defEnc = NSISOArabicStringEncoding; - else if (strcmp(encoding, "ISO-8859-7") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-7") == 0 /* AIX IRIX OSF/1 Solaris */ - || strcmp(encoding, "iso88597") == 0 /* HP-UX */) - defEnc = NSISOGreekStringEncoding; - else if (strcmp(encoding, "ISO-8859-8") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-8") == 0 /* AIX OSF/1 Solaris */ - || strcmp(encoding, "iso88598") == 0 /* HP-UX */) - defEnc = NSISOHebrewStringEncoding; - else if (strcmp(encoding, "ISO-8859-9") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-9") == 0 /* AIX IRIX OSF/1 Solaris */ - || strcmp(encoding, "iso88599") == 0 /* HP-UX */) - defEnc = NSISOLatin5StringEncoding; - else if (strcmp(encoding, "ISO-8859-10") == 0 /* */ - || strcmp(encoding, "ISO8859-10") == 0 /* */) - defEnc = NSISOLatin6StringEncoding; - else if (strcmp(encoding, "TIS-620") == 0 /* glibc AIX */ - || strcmp(encoding, "tis620") == 0 /* HP-UX */ - || strcmp(encoding, "TIS620.2533") == 0 /* Solaris */ - || strcmp(encoding, "TACTIS") == 0 /* OSF/1 */) - defEnc = NSISOThaiStringEncoding; - else if (strcmp(encoding, "ISO-8859-13") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-13") == 0 /* */ - || strcmp(encoding, "IBM-921") == 0 /* AIX */) - defEnc = NSISOLatin7StringEncoding; - else if (strcmp(encoding, "ISO-8859-14") == 0 /* glibc */ - || strcmp(encoding, "ISO8859-14") == 0 /* */) - defEnc = NSISOLatin8StringEncoding; - else if (strcmp(encoding, "ISO-8859-15") == 0 /* glibc */ - /* AIX OSF/1 Solaris NetBSD */ - || strcmp(encoding, "ISO8859-15") == 0 - || strcmp(encoding, "iso885915") == 0 /* HP-UX */) - defEnc = NSISOLatin9StringEncoding; - else if (strcmp(encoding, "GB2312") == 0 /* glibc */ - || strcmp(encoding, "gb2312") == 0 /* Solaris */ - || strcmp(encoding, "eucCN") == 0 /* IRIX NetBSD */ - || strcmp(encoding, "IBM-eucCN") == 0 /* AIX */ - || strcmp(encoding, "hp15CN") == 0 /* HP-UX */) - defEnc = NSGB2312StringEncoding; - else if (strcmp(encoding, "BIG5") == 0 /* glibc Solaris NetBSD */ - || strcmp(encoding, "big5") == 0 /* AIX HP-UX OSF/1 */) - defEnc = NSBIG5StringEncoding; - else if (strcmp(encoding, "EUC-KR") == 0 /* glibc */ - || strcmp(encoding, "eucKR") == 0 /* HP-UX IRIX OSF/1 NetBSD */ - || strcmp(encoding, "IBM-eucKR") == 0 /* AIX */ - || strcmp(encoding, "5601") == 0 /* Solaris */) - defEnc = NSKoreanEUCStringEncoding; - else -#endif - defEnc = NSISOLatin1StringEncoding; - } - else if (GSEncodingSupported(defEnc) == NO) - { - fprintf(stderr, "WARNING: %s - encoding not implemented as " - "default c string encoding.\n", encoding); - fprintf(stderr, - " NSISOLatin1StringEncoding set as default.\n"); - defEnc = NSISOLatin1StringEncoding; - } - [local_lock unlock]; - } - return defEnc; -} - -BOOL -GSIsByteEncoding(NSStringEncoding encoding) -{ - if (GSEncodingSupported(encoding) == NO) - { - return NO; - } - return encodingTable[encoding]->eightBit; -} - -/** - * Returns the standard name for the specified encoding. - */ -#ifndef NeXT_Foundation_LIBRARY -NSString* -GSEncodingName(NSStringEncoding encoding) -{ - if (GSEncodingSupported(encoding) == NO) - { - return @"Unknown encoding"; - } - return [NSString stringWithCString: encodingTable[encoding]->ename]; -} -#endif - -/** - * deprecated Use GSEncodingName() - */ -#ifndef NeXT_Foundation_LIBRARY -NSString* -GetEncodingName(NSStringEncoding encoding) -{ - return GSEncodingName(encoding); -} -#endif - -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -unichar -encode_chartouni(unsigned char c, NSStringEncoding enc) -{ - BOOL result; - unsigned int size = 1; - unichar u = 0; - unichar *dst = &u; - - result = GSToUnicode(&dst, &size, &c, 1, enc, 0, 0); - if (result == NO) - { - return 0; - } - return u; -} - -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -unsigned char -encode_unitochar(unichar u, NSStringEncoding enc) -{ - BOOL result; - unsigned int size = 1; - unsigned char c = 0; - unsigned char *dst = &c; - - result = GSFromUnicode(&dst, &size, &u, 1, enc, 0, 0); - if (result == NO) - { - return 0; - } - return c; -} - -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -unsigned -encode_unitochar_strict(unichar u, NSStringEncoding enc) -{ - BOOL result; - unsigned int size = 1; - unsigned char c = 0; - unsigned char *dst = &c; - - result = GSFromUnicode(&dst, &size, &u, 1, enc, 0, GSUniStrict); - if (result == NO) - { - return 0; - } - return c; -} - -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -unichar -chartouni(unsigned char c) -{ - if (defEnc == GSUndefinedEncoding) - { - defEnc = GetDefEncoding(); - } - return encode_chartouni(c, defEnc); -} - -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -unsigned char -unitochar(unichar u) -{ - if (defEnc == GSUndefinedEncoding) - { - defEnc = GetDefEncoding(); - } - return encode_unitochar(u, defEnc); -} - /** * Uses direct access into a two-level table to map cases.
* The two-level table method is less space efficient (but still not bad) than @@ -1050,46 +756,6 @@ uni_is_decomp(unichar u) } } -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -int encode_ustrtocstr(char *dst, int dl, const unichar *src, int sl, - NSStringEncoding enc, BOOL strict) -{ - BOOL result; - unsigned int options = (strict == YES) ? GSUniStrict : 0; - unsigned int old = dl; - - result = GSFromUnicode((unsigned char**)&dst, (unsigned int*)&dl, - src, sl, enc, 0, options); - if (result == NO) - { - return 0; - } - return old - dl; // Number of characters. -} - -/** - * deprecated - * See GSToUnicode() and GSFromUnicode() - */ -int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl, - NSStringEncoding enc) -{ - BOOL result; - unsigned int old = dl; - - result = GSToUnicode(&dst, (unsigned int*)&dl, (unsigned char*)src, - sl, enc, 0, 0); - if (result == NO) - { - return 0; - } - return old - dl; -} - - /** * Function to check a block of data for validity as a unicode string and * say whether it contains solely ASCII or solely Latin1 data.
@@ -1531,7 +1197,7 @@ tables: const char *estr = 0; BOOL done = NO; - if (GSEncodingSupported(enc) == YES) + if (isEncodingSupported(enc) == YES) { estr = encodingTable[enc]->iconv; } @@ -1552,7 +1218,7 @@ tables: if (cd == (iconv_t)-1) { NSLog(@"No iconv for encoding %@ tried to use %s", - GetEncodingName(enc), estr); + [_GSPrivate encodingName: enc], estr); result = NO; goto done; } @@ -2224,7 +1890,7 @@ iconv_start: const char *estr = 0; BOOL done = NO; - if (GSEncodingSupported(enc) == YES) + if (isEncodingSupported(enc) == YES) { if (strict == NO) { @@ -2257,7 +1923,7 @@ iconv_start: if (cd == (iconv_t)-1) { NSLog(@"No iconv for encoding %@ tried to use %s", - GetEncodingName(enc), estr); + [_GSPrivate encodingName: enc], estr); result = NO; goto done; } @@ -2414,3 +2080,231 @@ iconv_start: #undef GROW +@implementation _GSPrivate (Unicode) + ++ (NSStringEncoding*) availableEncodings +{ + if (_availableEncodings == 0) + { + GSSetupEncodingTable(); + [GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock]; + if (_availableEncodings == 0) + { + NSStringEncoding *encodings; + unsigned pos; + unsigned i; + + /* + * Now build up a list of supported encodings ... in the + * format needed to support [NSString+availableStringEncodings] + * Check to see what iconv support we have as we go along. + * This is also the place where we determine the name we use + * for iconv to support unicode. + */ + encodings = objc_malloc(sizeof(NSStringEncoding) * (encTableSize+1)); + pos = 0; + for (i = 0; i < encTableSize+1; i++) + { + if (isEncodingSupported(i) == YES) + { + encodings[pos++] = i; + } + } + encodings[pos] = 0; + _availableEncodings = encodings; + } + [local_lock unlock]; + } + return _availableEncodings; +} + ++ (NSStringEncoding) defaultCStringEncoding +{ + if (defEnc == GSUndefinedEncoding) + { + char *encoding; + unsigned int count; + + GSSetupEncodingTable(); + + [GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock]; + if (defEnc != GSUndefinedEncoding) + { + [local_lock unlock]; + return defEnc; + } + + encoding = getenv("GNUSTEP_STRING_ENCODING"); + if (encoding != 0) + { + count = 0; + while (str_encoding_table[count].enc + && strcasecmp(str_encoding_table[count].ename, encoding) + && strcasecmp(str_encoding_table[count].iconv, encoding)) + { + count++; + } + if (str_encoding_table[count].enc) + { + defEnc = str_encoding_table[count].enc; + } + else + { + fprintf(stderr, + "WARNING: %s - encoding not supported.\n", encoding); + fprintf(stderr, + " NSISOLatin1StringEncoding set as default.\n"); + defEnc = NSISOLatin1StringEncoding; + } + } + if (defEnc == GSUndefinedEncoding) + { + /* Encoding not set */ +#if HAVE_LANGINFO_CODESET + /* Take it from the system locale information. */ + encoding = nl_langinfo(CODESET); +/* + * First handle the fallback response from nl_langinfo() ... + * if we are getting the default value we can't assume that + * the user has set anything up at all, so we must use the + * OpenStep/GNUstep default encopding ... latin1, even though + * the nl_langinfo() stuff would say default is ascii. + */ + if (strcmp(encoding, "ANSI_X3.4-1968") == 0 /* glibc */ + || strcmp(encoding, "ISO_646.IRV:1983") == 0 /* glibc */ + || strcmp(encoding, "646") == 0 /* Solaris NetBSD */) + defEnc = NSISOLatin1StringEncoding; + else if (strcmp(encoding, "EUC-JP") == 0 /* glibc */ + /* HP-UX IRIX OSF/1 Solaris NetBSD */ + || strcmp(encoding, "eucJP") == 0 + || strcmp(encoding, "IBM-eucJP") == 0 /* AIX */) + defEnc = NSJapaneseEUCStringEncoding; + else if (strcmp(encoding, "UTF-8") == 0 /* glibc AIX OSF/1 Solaris */ + || strcmp(encoding, "utf8") == 0 /* HP-UX */) + defEnc = NSUTF8StringEncoding; + else if (strcmp(encoding, "ISO-8859-1") == 0 /* glibc */ + /* AIX IRIX OSF/1 Solaris NetBSD */ + || strcmp(encoding, "ISO8859-1") == 0 + || strcmp(encoding, "iso88591") == 0 /* HP-UX */) + defEnc = NSISOLatin1StringEncoding; + else if (strcmp(encoding, "IBM-932") == 0 /* AIX */ + || strcmp(encoding, "SJIS") == 0 /* HP-UX OSF/1 NetBSD */ + || strcmp(encoding, "PCK") == 0 /* Solaris */) + defEnc = NSShiftJISStringEncoding; + else if (strcmp(encoding, "ISO-8859-2") == 0 /* glibc */ + /* AIX IRIX OSF/1 Solaris NetBSD */ + || strcmp(encoding, "ISO8859-2") == 0 + || strcmp(encoding, "iso88592") == 0 /* HP-UX */) + defEnc = NSISOLatin2StringEncoding; + else if (strcmp(encoding, "CP1251") == 0 /* glibc */ + || strcmp(encoding, "ansi-1251") == 0 /* Solaris */) + defEnc = NSWindowsCP1251StringEncoding; + else if (strcmp(encoding, "CP1252") == 0 /* */ + || strcmp(encoding, "IBM-1252") == 0 /* AIX */) + defEnc = NSWindowsCP1252StringEncoding; + else if (strcmp(encoding, "ISO-8859-5") == 0 /* glibc */ + /* AIX IRIX OSF/1 Solaris NetBSD */ + || strcmp(encoding, "ISO8859-5") == 0 + || strcmp(encoding, "iso88595") == 0 /* HP-UX */) + defEnc = NSISOCyrillicStringEncoding; + else if (strcmp(encoding, "KOI8-R") == 0 /* glibc */ + || strcmp(encoding, "koi8-r") == 0 /* Solaris */) + defEnc = NSKOI8RStringEncoding; + else if (strcmp(encoding, "ISO-8859-3") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-3") == 0 /* Solaris */) + defEnc = NSISOLatin3StringEncoding; + else if (strcmp(encoding, "ISO-8859-4") == 0 /* */ + || strcmp(encoding, "ISO8859-4") == 0 /* OSF/1 Solaris NetBSD */) + defEnc = NSISOLatin4StringEncoding; + else if (strcmp(encoding, "ISO-8859-6") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-6") == 0 /* AIX Solaris */ + || strcmp(encoding, "iso88596") == 0 /* HP-UX */) + defEnc = NSISOArabicStringEncoding; + else if (strcmp(encoding, "ISO-8859-7") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-7") == 0 /* AIX IRIX OSF/1 Solaris */ + || strcmp(encoding, "iso88597") == 0 /* HP-UX */) + defEnc = NSISOGreekStringEncoding; + else if (strcmp(encoding, "ISO-8859-8") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-8") == 0 /* AIX OSF/1 Solaris */ + || strcmp(encoding, "iso88598") == 0 /* HP-UX */) + defEnc = NSISOHebrewStringEncoding; + else if (strcmp(encoding, "ISO-8859-9") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-9") == 0 /* AIX IRIX OSF/1 Solaris */ + || strcmp(encoding, "iso88599") == 0 /* HP-UX */) + defEnc = NSISOLatin5StringEncoding; + else if (strcmp(encoding, "ISO-8859-10") == 0 /* */ + || strcmp(encoding, "ISO8859-10") == 0 /* */) + defEnc = NSISOLatin6StringEncoding; + else if (strcmp(encoding, "TIS-620") == 0 /* glibc AIX */ + || strcmp(encoding, "tis620") == 0 /* HP-UX */ + || strcmp(encoding, "TIS620.2533") == 0 /* Solaris */ + || strcmp(encoding, "TACTIS") == 0 /* OSF/1 */) + defEnc = NSISOThaiStringEncoding; + else if (strcmp(encoding, "ISO-8859-13") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-13") == 0 /* */ + || strcmp(encoding, "IBM-921") == 0 /* AIX */) + defEnc = NSISOLatin7StringEncoding; + else if (strcmp(encoding, "ISO-8859-14") == 0 /* glibc */ + || strcmp(encoding, "ISO8859-14") == 0 /* */) + defEnc = NSISOLatin8StringEncoding; + else if (strcmp(encoding, "ISO-8859-15") == 0 /* glibc */ + /* AIX OSF/1 Solaris NetBSD */ + || strcmp(encoding, "ISO8859-15") == 0 + || strcmp(encoding, "iso885915") == 0 /* HP-UX */) + defEnc = NSISOLatin9StringEncoding; + else if (strcmp(encoding, "GB2312") == 0 /* glibc */ + || strcmp(encoding, "gb2312") == 0 /* Solaris */ + || strcmp(encoding, "eucCN") == 0 /* IRIX NetBSD */ + || strcmp(encoding, "IBM-eucCN") == 0 /* AIX */ + || strcmp(encoding, "hp15CN") == 0 /* HP-UX */) + defEnc = NSGB2312StringEncoding; + else if (strcmp(encoding, "BIG5") == 0 /* glibc Solaris NetBSD */ + || strcmp(encoding, "big5") == 0 /* AIX HP-UX OSF/1 */) + defEnc = NSBIG5StringEncoding; + else if (strcmp(encoding, "EUC-KR") == 0 /* glibc */ + || strcmp(encoding, "eucKR") == 0 /* HP-UX IRIX OSF/1 NetBSD */ + || strcmp(encoding, "IBM-eucKR") == 0 /* AIX */ + || strcmp(encoding, "5601") == 0 /* Solaris */) + defEnc = NSKoreanEUCStringEncoding; + else +#endif + defEnc = NSISOLatin1StringEncoding; + } + else if (isEncodingSupported(defEnc) == NO) + { + fprintf(stderr, "WARNING: %s - encoding not implemented as " + "default c string encoding.\n", encoding); + fprintf(stderr, + " NSISOLatin1StringEncoding set as default.\n"); + defEnc = NSISOLatin1StringEncoding; + } + [local_lock unlock]; + } + return defEnc; +} + ++ (NSString*) encodingName: (NSStringEncoding)encoding +{ + if (isEncodingSupported(encoding) == NO) + { + return @"Unknown encoding"; + } + return [NSString stringWithUTF8String: encodingTable[encoding]->ename]; +} + ++ (BOOL) isByteEncoding: (NSStringEncoding)encoding +{ + if (isEncodingSupported(encoding) == NO) + { + return NO; + } + return encodingTable[encoding]->eightBit; +} + ++ (BOOL) isEncodingSupported: (NSStringEncoding)encoding +{ + return isEncodingSupported(encoding); +} + +@end + diff --git a/Headers/Additions/GNUstepBase/unicode/caseconv.h b/Source/Additions/unicode/caseconv.h similarity index 98% rename from Headers/Additions/GNUstepBase/unicode/caseconv.h rename to Source/Additions/unicode/caseconv.h index b7754b9b1..e1107bfa0 100644 --- a/Headers/Additions/GNUstepBase/unicode/caseconv.h +++ b/Source/Additions/unicode/caseconv.h @@ -8,7 +8,7 @@ are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ -unichar gs_casemap_empty_table[] = { +static unichar gs_casemap_empty_table[] = { 0x0, 0x0, 0x0, @@ -267,7 +267,7 @@ unichar gs_casemap_empty_table[] = { 0x0, }; -unichar gs_tolower_map_table_0[] = { +static unichar gs_tolower_map_table_0[] = { 0x0, 0x0, 0x0, @@ -525,7 +525,8 @@ unichar gs_tolower_map_table_0[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_1[] = { + +static unichar gs_tolower_map_table_1[] = { 0x101, /* 0 */ 0x0, 0x103, /* 2 */ @@ -783,7 +784,8 @@ unichar gs_tolower_map_table_1[] = { 0x1ff, /* fe */ 0x0, }; -unichar gs_tolower_map_table_2[] = { + +static unichar gs_tolower_map_table_2[] = { 0x201, /* 0 */ 0x0, 0x203, /* 2 */ @@ -1041,7 +1043,8 @@ unichar gs_tolower_map_table_2[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_3[] = { + +static unichar gs_tolower_map_table_3[] = { 0x0, 0x0, 0x0, @@ -1299,7 +1302,8 @@ unichar gs_tolower_map_table_3[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_4[] = { + +static unichar gs_tolower_map_table_4[] = { 0x450, /* 0 */ 0x451, /* 1 */ 0x452, /* 2 */ @@ -1557,7 +1561,8 @@ unichar gs_tolower_map_table_4[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_5[] = { + +static unichar gs_tolower_map_table_5[] = { 0x0, 0x0, 0x0, @@ -1815,7 +1820,8 @@ unichar gs_tolower_map_table_5[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_1e[] = { + +static unichar gs_tolower_map_table_1e[] = { 0x1e01, /* 0 */ 0x0, 0x1e03, /* 2 */ @@ -2073,7 +2079,8 @@ unichar gs_tolower_map_table_1e[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_1f[] = { + +static unichar gs_tolower_map_table_1f[] = { 0x0, 0x0, 0x0, @@ -2331,7 +2338,8 @@ unichar gs_tolower_map_table_1f[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_21[] = { + +static unichar gs_tolower_map_table_21[] = { 0x0, 0x0, 0x0, @@ -2589,7 +2597,8 @@ unichar gs_tolower_map_table_21[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_24[] = { + +static unichar gs_tolower_map_table_24[] = { 0x0, 0x0, 0x0, @@ -2847,7 +2856,8 @@ unichar gs_tolower_map_table_24[] = { 0x0, 0x0, }; -unichar gs_tolower_map_table_ff[] = { + +static unichar gs_tolower_map_table_ff[] = { 0x0, 0x0, 0x0, @@ -3106,7 +3116,7 @@ unichar gs_tolower_map_table_ff[] = { 0x0, }; -unichar *gs_tolower_map[] = { +static unichar *gs_tolower_map[] = { gs_tolower_map_table_0, gs_tolower_map_table_1, gs_tolower_map_table_2, @@ -3365,7 +3375,7 @@ unichar *gs_tolower_map[] = { gs_tolower_map_table_ff, }; -unichar gs_toupper_map_table_0[] = { +static unichar gs_toupper_map_table_0[] = { 0x0, 0x0, 0x0, @@ -3624,7 +3634,7 @@ unichar gs_toupper_map_table_0[] = { 0x178, /* ff */ }; -unichar gs_toupper_map_table_1[] = { +static unichar gs_toupper_map_table_1[] = { 0x0, 0x100, /* 1 */ 0x0, @@ -3883,7 +3893,7 @@ unichar gs_toupper_map_table_1[] = { 0x1fe, /* ff */ }; -unichar gs_toupper_map_table_2[] = { +static unichar gs_toupper_map_table_2[] = { 0x0, 0x200, /* 1 */ 0x0, @@ -4142,7 +4152,7 @@ unichar gs_toupper_map_table_2[] = { 0x0, }; -unichar gs_toupper_map_table_3[] = { +static unichar gs_toupper_map_table_3[] = { 0x0, 0x0, 0x0, @@ -4401,7 +4411,7 @@ unichar gs_toupper_map_table_3[] = { 0x0, }; -unichar gs_toupper_map_table_4[] = { +static unichar gs_toupper_map_table_4[] = { 0x0, 0x0, 0x0, @@ -4660,7 +4670,7 @@ unichar gs_toupper_map_table_4[] = { 0x0, }; -unichar gs_toupper_map_table_5[] = { +static unichar gs_toupper_map_table_5[] = { 0x0, 0x0, 0x0, @@ -4919,31 +4929,7 @@ unichar gs_toupper_map_table_5[] = { 0x0, }; - - - - - - - - - - - - - - - - - - - - - - - - -unichar gs_toupper_map_table_1e[] = { +static unichar gs_toupper_map_table_1e[] = { 0x0, 0x1e00, /* 1 */ 0x0, @@ -5202,7 +5188,7 @@ unichar gs_toupper_map_table_1e[] = { 0x0, }; -unichar gs_toupper_map_table_1f[] = { +static unichar gs_toupper_map_table_1f[] = { 0x1f08, /* 0 */ 0x1f09, /* 1 */ 0x1f0a, /* 2 */ @@ -5461,8 +5447,7 @@ unichar gs_toupper_map_table_1f[] = { 0x0, }; - -unichar gs_toupper_map_table_21[] = { +static unichar gs_toupper_map_table_21[] = { 0x0, 0x0, 0x0, @@ -5721,9 +5706,7 @@ unichar gs_toupper_map_table_21[] = { 0x0, }; - - -unichar gs_toupper_map_table_24[] = { +static unichar gs_toupper_map_table_24[] = { 0x0, 0x0, 0x0, @@ -5982,225 +5965,7 @@ unichar gs_toupper_map_table_24[] = { 0x0, }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -unichar gs_toupper_map_table_ff[] = { +static unichar gs_toupper_map_table_ff[] = { 0x0, 0x0, 0x0, @@ -6459,8 +6224,7 @@ unichar gs_toupper_map_table_ff[] = { 0x0, }; - -unichar *gs_toupper_map[] = { +static unichar *gs_toupper_map[] = { gs_toupper_map_table_0, gs_toupper_map_table_1, gs_toupper_map_table_2, diff --git a/Headers/Additions/GNUstepBase/unicode/cop.h b/Source/Additions/unicode/cop.h similarity index 98% rename from Headers/Additions/GNUstepBase/unicode/cop.h rename to Source/Additions/unicode/cop.h index 7d74be7d1..5e80ea872 100644 --- a/Headers/Additions/GNUstepBase/unicode/cop.h +++ b/Source/Additions/unicode/cop.h @@ -9,9 +9,9 @@ struct _cop_ {unichar code; unsigned char cop;}; -const unsigned int uni_cop_table_size = 355; -struct _cop_ uni_cop_table[]= +static const unsigned int uni_cop_table_size = 355; +static struct _cop_ uni_cop_table[]= { {0x0300,230}, {0x0301,230}, diff --git a/Headers/Additions/GNUstepBase/unicode/cyrillic.h b/Source/Additions/unicode/cyrillic.h similarity index 94% rename from Headers/Additions/GNUstepBase/unicode/cyrillic.h rename to Source/Additions/unicode/cyrillic.h index 4096eb2d1..7facce19d 100644 --- a/Headers/Additions/GNUstepBase/unicode/cyrillic.h +++ b/Source/Additions/unicode/cyrillic.h @@ -8,9 +8,8 @@ */ -const unsigned int Cyrillic_conv_base = 0x80; - -unichar Cyrillic_char_to_uni_table[] = +static const unsigned int Cyrillic_conv_base = 0x80; +static unichar Cyrillic_char_to_uni_table[] = { 0x0080, 0x0081, @@ -144,9 +143,8 @@ unichar Cyrillic_char_to_uni_table[] = // Unicode to ISO_8859-5,1988 maping -const unsigned int Cyrillic_uni_to_char_table_size = 128; - -_ucc_ Cyrillic_uni_to_char_table[]= +static const unsigned int Cyrillic_uni_to_char_table_size = 128; +static _ucc_ Cyrillic_uni_to_char_table[]= { {0x0080,0x80}, {0x0081,0x81}, diff --git a/Headers/Additions/GNUstepBase/unicode/decomp.h b/Source/Additions/unicode/decomp.h similarity index 99% rename from Headers/Additions/GNUstepBase/unicode/decomp.h rename to Source/Additions/unicode/decomp.h index 1b94a6881..54c8919ad 100644 --- a/Headers/Additions/GNUstepBase/unicode/decomp.h +++ b/Source/Additions/unicode/decomp.h @@ -9,9 +9,9 @@ struct _dec_ {unichar code; unichar decomp[5];}; -const unsigned int uni_dec_table_size = 1052; -struct _dec_ uni_dec_table[]= +static const unsigned int uni_dec_table_size = 1052; +static struct _dec_ uni_dec_table[]= { {0x00C0, {0x0041, 0x0300, 0}}, {0x00C1, {0x0041, 0x0301, 0}}, diff --git a/Headers/Additions/GNUstepBase/unicode/gsm0338.h b/Source/Additions/unicode/gsm0338.h similarity index 96% rename from Headers/Additions/GNUstepBase/unicode/gsm0338.h rename to Source/Additions/unicode/gsm0338.h index d9c164772..af7d8e21a 100644 --- a/Headers/Additions/GNUstepBase/unicode/gsm0338.h +++ b/Source/Additions/unicode/gsm0338.h @@ -10,9 +10,8 @@ // GSM0338 to Unicode maping -const unsigned int GSM0338_conv_base = 0x00; - -unichar GSM0338_char_to_uni_table[] = +static const unsigned int GSM0338_conv_base = 0x00; +static unichar GSM0338_char_to_uni_table[] = { 0x0040, 0x00A3, @@ -144,7 +143,7 @@ unichar GSM0338_char_to_uni_table[] = 0x00E0 }; -_ucc_ GSM0338_uni_to_char_table[] = +static _ucc_ GSM0338_uni_to_char_table[] = { {0x000A,0x0A,}, {0x000D,0x0D,}, @@ -277,7 +276,7 @@ _ucc_ GSM0338_uni_to_char_table[] = }; #define GSM0338_tsize (sizeof(GSM0338_uni_to_char_table)/sizeof(_ucc_)) -_ucc_ GSM0338_escapes[] = +static _ucc_ GSM0338_escapes[] = { {0x000C,0x0A}, /* Form feed */ {0x005B,0x3C}, /* '[' */ @@ -300,7 +299,7 @@ _ucc_ GSM0338_escapes[] = * a cut down version suitable for use when delivering data to phones * which don't support escape sequences. */ -_ucc_ GSM0338_lossy[] = +static _ucc_ GSM0338_lossy[] = { {0x005B,0x3C}, /* '[' => '<' */ {0x005C,0x2F}, /* '\\' => '/' */ diff --git a/Headers/Additions/GNUstepBase/unicode/latin2.h b/Source/Additions/unicode/latin2.h similarity index 95% rename from Headers/Additions/GNUstepBase/unicode/latin2.h rename to Source/Additions/unicode/latin2.h index 743d57e04..df7e18f0f 100644 --- a/Headers/Additions/GNUstepBase/unicode/latin2.h +++ b/Source/Additions/unicode/latin2.h @@ -10,9 +10,8 @@ // ISO_8859-2 to Unicode maping -const unsigned int Latin2_conv_base = 0x80; - -unichar Latin2_char_to_uni_table[] = +static const unsigned int Latin2_conv_base = 0x80; +static unichar Latin2_char_to_uni_table[] = { 0x0080, 0x0081, @@ -146,9 +145,8 @@ unichar Latin2_char_to_uni_table[] = // Unicode to ISO_8859-2 maping -const unsigned int Latin2_uni_to_char_table_size = 128; - -_ucc_ Latin2_uni_to_char_table[]= +static const unsigned int Latin2_uni_to_char_table_size = 128; +static _ucc_ Latin2_uni_to_char_table[]= { {0x0080,0x80}, {0x0081,0x81}, diff --git a/Headers/Additions/GNUstepBase/unicode/latin9.h b/Source/Additions/unicode/latin9.h similarity index 95% rename from Headers/Additions/GNUstepBase/unicode/latin9.h rename to Source/Additions/unicode/latin9.h index 8f3b36419..7826cbcbb 100644 --- a/Headers/Additions/GNUstepBase/unicode/latin9.h +++ b/Source/Additions/unicode/latin9.h @@ -10,9 +10,8 @@ // ISO_8859-15 to Unicode maping -const unsigned int Latin9_conv_base = 0x80; - -unichar Latin9_char_to_uni_table[] = +static const unsigned int Latin9_conv_base = 0x80; +static unichar Latin9_char_to_uni_table[] = { 0x0080, 0x0081, @@ -146,9 +145,8 @@ unichar Latin9_char_to_uni_table[] = // Unicode to ISO_8859-15 maping -const unsigned int Latin9_uni_to_char_table_size = 128; - -_ucc_ Latin9_uni_to_char_table[]= +static const unsigned int Latin9_uni_to_char_table_size = 128; +static _ucc_ Latin9_uni_to_char_table[]= { {0x0080, 0x80}, {0x0081, 0x81}, diff --git a/Headers/Additions/GNUstepBase/unicode/nextstep.h b/Source/Additions/unicode/nextstep.h similarity index 94% rename from Headers/Additions/GNUstepBase/unicode/nextstep.h rename to Source/Additions/unicode/nextstep.h index 979ae6201..95c881a9f 100644 --- a/Headers/Additions/GNUstepBase/unicode/nextstep.h +++ b/Source/Additions/unicode/nextstep.h @@ -7,8 +7,8 @@ notice and this notice are preserved. */ -const unsigned int Next_conv_base = 0x80; -unichar Next_char_to_uni_table[] = +static const unsigned int Next_conv_base = 0x80; +static unichar Next_char_to_uni_table[] = { 0x00A0, 0x00C0, @@ -135,9 +135,8 @@ unichar Next_char_to_uni_table[] = // Unicode to NextStep maping -const unsigned int Next_uni_to_char_table_size = 128; - -_ucc_ Next_uni_to_char_table[]= +static const unsigned int Next_uni_to_char_table_size = 128; +static _ucc_ Next_uni_to_char_table[]= { {0x00A0,0x80}, {0x00A1,0xA1}, diff --git a/Headers/Additions/GNUstepBase/unicode/thai.h b/Source/Additions/unicode/thai.h similarity index 93% rename from Headers/Additions/GNUstepBase/unicode/thai.h rename to Source/Additions/unicode/thai.h index 54b6c259a..ddcae5935 100644 --- a/Headers/Additions/GNUstepBase/unicode/thai.h +++ b/Source/Additions/unicode/thai.h @@ -8,9 +8,8 @@ */ -const unsigned int Thai_conv_base = 0xA0; - -unichar Thai_char_to_uni_table[] = +static const unsigned int Thai_conv_base = 0xA0; +static unichar Thai_char_to_uni_table[] = { 0x00A0, 0x0E01, @@ -112,9 +111,8 @@ unichar Thai_char_to_uni_table[] = /* Unicode to ISO_8859-11 maping */ -const unsigned int Thai_uni_to_char_table_size = 88; - -_ucc_ Thai_uni_to_char_table[]= +static const unsigned int Thai_uni_to_char_table_size = 88; +static _ucc_ Thai_uni_to_char_table[]= { {0x00A0,0xA0}, {0x0E01,0xA1}, diff --git a/Source/GNUmakefile b/Source/GNUmakefile index bfbeff2af..dbe15ba71 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -370,17 +370,8 @@ NSValue.h \ NSXMLParser.h \ NSZone.h -UNICODE_HEADERS = \ -unicode/caseconv.h \ -unicode/cop.h \ -unicode/cyrillic.h \ -unicode/latin2.h \ -unicode/decomp.h \ -unicode/nextstep.h - HEADERS_INSTALL = $(GNU_HEADERS) \ - $(FOUNDATION_HEADERS) \ - $(UNICODE_HEADERS) + $(FOUNDATION_HEADERS) GENERATED_HFILES = \ dynamic-load.h \ diff --git a/Source/GSCompatibility.m b/Source/GSCompatibility.m index 9728439a4..11d971650 100644 --- a/Source/GSCompatibility.m +++ b/Source/GSCompatibility.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "config.h" @@ -43,17 +44,17 @@ static double rint(double a) BOOL GSMacOSXCompatibleGeometry(void) { - if (GSUserDefaultsFlag(GSOldStyleGeometry) == YES) + if ([_GSPrivate userDefaultsFlag: GSOldStyleGeometry] == YES) return NO; - return GSUserDefaultsFlag(GSMacOSXCompatible); + return [_GSPrivate userDefaultsFlag: GSMacOSXCompatible]; } BOOL GSMacOSXCompatiblePropertyLists(void) { #if defined(HAVE_LIBXML) - if (GSUserDefaultsFlag(NSWriteOldStylePropertyLists) == YES) + if ([_GSPrivate userDefaultsFlag: NSWriteOldStylePropertyLists] == YES) return NO; - return GSUserDefaultsFlag(GSMacOSXCompatible); + return [_GSPrivate userDefaultsFlag: GSMacOSXCompatible]; #else return NO; #endif diff --git a/Source/GSFFCallInvocation.m b/Source/GSFFCallInvocation.m index bc491be9e..c48ac6f83 100644 --- a/Source/GSFFCallInvocation.m +++ b/Source/GSFFCallInvocation.m @@ -168,7 +168,7 @@ gs_offset(const char *type, int index) /* Determines if the structure type can be returned entirely in registers. See the avcall or vacall man pages for more info. FIXME: I'm betting this won't work if a structure contains another structure */ -int +static int gs_splittable (const char *type) { int i, numtypes; @@ -297,7 +297,7 @@ gs_find_by_receiver_best_typed_sel (id receiver, SEL sel) Only passes the first part. Is used for determining the return type for the vacall macros. */ -void +static void gs_sel_type_to_callback_type (const char *sel_type, vacallReturnTypeInfo *vatype) { diff --git a/Source/GSFTPURLHandle.m b/Source/GSFTPURLHandle.m index 64d5a035e..1f1122295 100644 --- a/Source/GSFTPURLHandle.m +++ b/Source/GSFTPURLHandle.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "config.h" @@ -36,6 +37,7 @@ #include "Foundation/NSFileHandle.h" #include "Foundation/NSDebug.h" #include "GNUstepBase/GSMime.h" +#include "GSPrivate.h" GS_EXPORT NSString * const GSTelnetNotification; GS_EXPORT NSString * const GSTelnetErrorKey; @@ -972,14 +974,12 @@ static NSLock *urlLock = nil; protocol: @"tcp"]; if (sock == nil) { - extern int errno; - /* * Tell superclass that the load failed - let it do housekeeping. */ [self backgroundLoadDidFailWithReason: [NSString stringWithFormat: - @"Unable to connect to %@:%@ ... %s", - host, port, GSLastErrorStr(errno)]]; + @"Unable to connect to %@:%@ ... %@", + host, port, [_GSPrivate error]]]; return; } cHandle = [[GSTelnetHandle alloc] initWithHandle: sock isConnected: NO]; diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index 94523c5a9..546c853b9 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -42,6 +42,7 @@ #include "Foundation/NSProcessInfo.h" #include "Foundation/NSUserDefaults.h" #include "Foundation/NSDebug.h" +#include "GSPrivate.h" #include "../Tools/gdomap.h" @@ -797,7 +798,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == -1) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error: errno]); RELEASE(self); return nil; } @@ -811,8 +812,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { if (bind(net, (struct sockaddr *)&lsin, sizeof(lsin)) == -1) { - NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(lsin.sin_addr), - GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); + NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(lsin.sin_addr), + GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error: errno]); (void) close(net); RELEASE(self); return nil; @@ -830,9 +831,9 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { if (errno != EINPROGRESS) { - NSLog(@"unable to make connection to %s:%d - %s", + NSLog(@"unable to make connection to %s:%d - %@", inet_ntoa(sin.sin_addr), - GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); + GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]); RELEASE(self); return nil; } @@ -896,7 +897,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == -1) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); RELEASE(self); return nil; } @@ -913,8 +914,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) == -1) { - NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr), - GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); + NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr), + GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]); (void) close(net); RELEASE(self); return nil; @@ -922,7 +923,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (listen(net, 256) == -1) { - NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno)); + NSLog(@"unable to listen on port - %@", [_GSPrivate error]); (void) close(net); RELEASE(self); return nil; @@ -930,7 +931,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (getsockname(net, (struct sockaddr*)&sin, &size) == -1) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); (void) close(net); RELEASE(self); return nil; @@ -1095,8 +1096,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (fstat(desc, &sbuf) < 0) { - NSLog(@"unable to get status of descriptor %d - %s", - desc, GSLastErrorStr(errno)); + NSLog(@"unable to get status of descriptor %d - %@", + desc, [_GSPrivate error]); } else { @@ -1317,8 +1318,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (len < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } return d; } @@ -1342,8 +1343,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (len < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } return d; } @@ -1368,8 +1369,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (got < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } [d setLength: got]; } @@ -1391,8 +1392,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; else if (got < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } } while (len > 0 && got > 0); @@ -1437,8 +1438,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (rval < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to write to descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to write to descriptor - %@", + [_GSPrivate error]]; } } @@ -1543,8 +1544,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (result < 0) { [NSException raise: NSFileHandleOperationException - format: @"failed to move to offset in file - %s", - GSLastErrorStr(errno)]; + format: @"failed to move to offset in file - %@", + [_GSPrivate error]]; } return (unsigned long long)result; } @@ -1567,8 +1568,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (result < 0) { [NSException raise: NSFileHandleOperationException - format: @"failed to move to offset in file - %s", - GSLastErrorStr(errno)]; + format: @"failed to move to offset in file - %@", + [_GSPrivate error]]; } return (unsigned long long)result; } @@ -1591,8 +1592,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (result < 0) { [NSException raise: NSFileHandleOperationException - format: @"failed to move to offset in file - %s", - GSLastErrorStr(errno)]; + format: @"failed to move to offset in file - %@", + [_GSPrivate error]]; } } @@ -1927,8 +1928,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Accept attempt failed - %s", - GSLastErrorStr(errno)]; + s = [NSString stringWithFormat: @"Accept attempt failed - %@", + [_GSPrivate error]]; [readInfo setObject: s forKey: GSFileHandleNotificationError]; } else @@ -1995,8 +1996,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Read attempt failed - %s", - GSLastErrorStr(errno)]; + s = [NSString stringWithFormat: @"Read attempt failed - %@", + [_GSPrivate error]]; [readInfo setObject: s forKey: GSFileHandleNotificationError]; [self postReadNotification]; } @@ -2031,8 +2032,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Connect attempt failed - %s", - GSLastErrorStr(result)]; + s = [NSString stringWithFormat: @"Connect attempt failed - %@", + [_GSPrivate error]]; [info setObject: s forKey: GSFileHandleNotificationError]; } else @@ -2065,7 +2066,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; NSString *s; s = [NSString stringWithFormat: - @"Write attempt failed - %s", GSLastErrorStr(errno)]; + @"Write attempt failed - %@", [_GSPrivate error]]; [info setObject: s forKey: GSFileHandleNotificationError]; [self postWriteNotification]; } @@ -2141,8 +2142,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; } if (fcntl(descriptor, F_SETFL, e) < 0) { - NSLog(@"unable to set non-blocking mode for %d - %s", - descriptor, GSLastErrorStr(errno)); + NSLog(@"unable to set non-blocking mode for %d - %@", + descriptor, [_GSPrivate error]); } else { @@ -2151,8 +2152,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; } else { - NSLog(@"unable to get non-blocking mode for %d - %s", - descriptor, GSLastErrorStr(errno)); + NSLog(@"unable to get non-blocking mode for %d - %@", + descriptor, [_GSPrivate error]); } } } @@ -2170,11 +2171,11 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == -1) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); } else { - str = [NSString stringWithCString: (char*)inet_ntoa(sin.sin_addr)]; + str = [NSString stringWithUTF8String: (char*)inet_ntoa(sin.sin_addr)]; } return str; } @@ -2187,7 +2188,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == -1) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); } else { diff --git a/Source/GSFormat.m b/Source/GSFormat.m index fb0ab5693..f6c4ebd92 100644 --- a/Source/GSFormat.m +++ b/Source/GSFormat.m @@ -758,6 +758,10 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec, return nargs; } +static inline void GSStrAppendUnichar(GSStr s, unichar u) +{ + GSStrAppendUnichars(s, &u, 1); +} #define outchar(Ch) GSStrAppendUnichar(s, Ch) #define outstring(String, Len) GSStrAppendUnichars(s, String, Len) @@ -1690,9 +1694,9 @@ NSDictionary *locale) LABEL (form_strerror): /* Print description of error ERRNO. */ - string = - (unichar *) GSLastErrorStr(save_errno); - is_long = 0; /* This is no wide-char string. */ + string = (unichar *)[[_GSPrivate error: save_errno] + cStringUsingEncoding: NSUnicodeStringEncoding]; + is_long = 1; /* This is a unicode string. */ goto LABEL (print_string); LABEL (form_character): /* Character. */ @@ -1735,7 +1739,7 @@ NSDictionary *locale) { /* Write "(null)" if there's space. */ if (prec == -1 - || prec >= (int) (sizeof (null) / sizeof (null[0])) - 1) + || prec >= (int) (sizeof (null) / sizeof (null[0])) - 1) { string = (unichar *) null; len = (sizeof (null) / sizeof (null[0])) - 1; @@ -1757,8 +1761,8 @@ NSDictionary *locale) if (enc == GSUndefinedEncoding) { - enc = GetDefEncoding(); - byteEncoding = GSIsByteEncoding(enc); + enc = [NSString defaultCStringEncoding]; + byteEncoding = [_GSPrivate isByteEncoding: enc]; } len = strlen(str); // Number of bytes to convert. diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index b69ac8518..c57959d29 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -45,6 +45,7 @@ #include "GNUstepBase/GSLock.h" #include "NSCallBacks.h" #include "GSURLPrivate.h" +#include "GSPrivate.h" #include #ifdef HAVE_UNISTD_H @@ -1267,8 +1268,8 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) * Tell superclass that the load failed - let it do housekeeping. */ [self backgroundLoadDidFailWithReason: - [NSString stringWithFormat: @"Unable to connect to %@:%@ ... %s", - host, port, GSLastErrorStr(errno)]]; + [NSString stringWithFormat: @"Unable to connect to %@:%@ ... %@", + host, port, [_GSPrivate error]]]; return; } RETAIN(sock); diff --git a/Source/GSLocale.m b/Source/GSLocale.m index 013496cf2..160eecd71 100644 --- a/Source/GSLocale.m +++ b/Source/GSLocale.m @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #include "config.h" #include "GNUstepBase/GSLocale.h" @@ -75,12 +76,12 @@ GSSetLocale(int category, NSString *locale) locale = nil; if (clocale != 0) { - locale = [NSString stringWithCString: clocale]; + locale = [NSString stringWithUTF8String: clocale]; } return locale; } -#define GSLanginfo(value) [NSString stringWithCString: nl_langinfo (value)] +#define GSLanginfo(value) [NSString stringWithUTF8String: nl_langinfo (value)] /* Creates a locale dictionary from information provided by i18n functions. Many, but not all, of the keys are filled in or inferred from the @@ -154,33 +155,33 @@ GSDomainFromDefaultLocale(void) /* Currency Information */ if (lconv->currency_symbol) { - [dict setObject: [NSString stringWithCString: lconv->currency_symbol] + [dict setObject: [NSString stringWithUTF8String: lconv->currency_symbol] forKey: NSCurrencySymbol]; } if (lconv->int_curr_symbol) { - [dict setObject: [NSString stringWithCString: lconv->int_curr_symbol] + [dict setObject: [NSString stringWithUTF8String: lconv->int_curr_symbol] forKey: NSInternationalCurrencyString]; } if (lconv->mon_decimal_point) { - [dict setObject: [NSString stringWithCString: lconv->mon_decimal_point] + [dict setObject: [NSString stringWithUTF8String: lconv->mon_decimal_point] forKey: NSInternationalCurrencyString]; } if (lconv->mon_thousands_sep) { - [dict setObject: [NSString stringWithCString: lconv->mon_thousands_sep] + [dict setObject: [NSString stringWithUTF8String: lconv->mon_thousands_sep] forKey: NSInternationalCurrencyString]; } if (lconv->decimal_point) { - [dict setObject: [NSString stringWithCString: lconv->decimal_point] + [dict setObject: [NSString stringWithUTF8String: lconv->decimal_point] forKey: NSDecimalSeparator]; } if (lconv->thousands_sep) { - [dict setObject: [NSString stringWithCString: lconv->thousands_sep] + [dict setObject: [NSString stringWithUTF8String: lconv->thousands_sep] forKey: NSThousandsSeparator]; } diff --git a/Source/GSPrivate.h b/Source/GSPrivate.h index 9c28e5381..8bccc6483 100644 --- a/Source/GSPrivate.h +++ b/Source/GSPrivate.h @@ -38,6 +38,7 @@ #include "GNUstepBase/GSObjCRuntime.h" +#include "Foundation/NSString.h" /** * Macro to manage memory for chunks of code that need to work with @@ -100,17 +101,6 @@ because NXConstantString returns a pointer to it's internal pointer. */ -/* - * Function to get the name of a string encoding as an NSString. - */ -GS_EXPORT NSString *GSEncodingName(NSStringEncoding encoding); - -/* - * Function to determine whether data in a particular encoding can - * generally be represented as 8-bit characters including ascii. - */ -GS_EXPORT BOOL GSIsByteEncoding(NSStringEncoding encoding); - /* * Type to hold either UTF-16 (unichar) or 8-bit encodings, * while satisfying alignment constraints. @@ -173,10 +163,15 @@ typedef struct { typedef GSStr_t *GSStr; /* - * Functions to append to GSStr + * Function to append to GSStr */ -extern void GSStrAppendUnichar(GSStr s, unichar); extern void GSStrAppendUnichars(GSStr s, const unichar *u, unsigned l); +/* + * Make the content of this string into unicode if it is not in + * the external defaults C string encoding. + */ +void GSStrExternalize(GSStr s); + /* * Enumeration for MacOS-X compatibility user defaults settings. @@ -192,21 +187,6 @@ typedef enum { GSUserDefaultMaxFlag // End marker. } GSUserDefaultFlagType; -/* - * Get the dictionary representation. - */ -NSDictionary *GSUserDefaultsDictionaryRepresentation(void); - -/* - * Get one of several potentially useful flags. - */ -BOOL GSUserDefaultsFlag(GSUserDefaultFlagType type); - -/** - * Get a flag from an environment variable - return def if not defined. - */ -BOOL GSEnvironmentFlag(const char *name, BOOL def); - /** @@ -238,5 +218,68 @@ extern void GSNotifyASAP(void); extern void GSNotifyIdle(void); extern BOOL GSNotifyMore(void); +/* This class exists to encapsulate various otherwise unrelated functions + * so that we expose a single global symbol (the class) whose name marks it + * very clearly as for private/internal use only. Avoiding the exposure + * (and hence possible accidental use) of symbols for each function ... + * The formal implementation of the class is a near empty implementation + * (in Additions/GSCategories.h), with most methods being provided by other + * categories in the files wishing to expose some functionality for use + * by other parts of the base library. + */ +@interface _GSPrivate : NSObject +/* Return the text describing the last system error to have occurred. + */ ++ (NSString*) error; ++ (NSString*) error: (long)number; +@end + +@interface _GSPrivate (ProcessInfo) +/* Used by NSException uncaught exception handler - must not call any + * methods/functions which might cause a recursive exception. + */ ++ (const char*) argZero; + +/* get a flag from an environment variable - return def if not defined. + */ ++ (BOOL) environmentFlag: (const char *)name defaultValue: (BOOL)def; +@end + +@interface _GSPrivate (Unicode) +/* get the available string encodings (nul terminated array) + */ ++ (NSStringEncoding*) availableEncodings; + +/* get the default C-string encoding. + */ ++ (NSStringEncoding) defaultCStringEncoding; + +/* get the name of a string encoding as an NSString. + */ ++ (NSString*) encodingName: (NSStringEncoding)encoding; + +/* determine whether data in a particular encoding can + * generally be represented as 8-bit characters including ascii. + */ ++ (BOOL) isByteEncoding: (NSStringEncoding)encoding; + +/* determine whether encoding is currently supported. + */ ++ (BOOL) isEncodingSupported: (NSStringEncoding)encoding; + +@end + +@interface _GSPrivate (UserDefaults) +/* + * Get the dictionary representation. + */ ++ (NSDictionary*) userDefaultsDictionaryRepresentation; + +/* + * Get one of several potentially useful flags. + */ ++ (BOOL) userDefaultsFlag: (GSUserDefaultFlagType)type; +@end + #endif /* __GSPrivate_h_ */ diff --git a/Source/GSStream.m b/Source/GSStream.m index f25b6bb3b..ddaa3bb1f 100644 --- a/Source/GSStream.m +++ b/Source/GSStream.m @@ -34,6 +34,7 @@ #include #include "GSStream.h" +#include "GSPrivate.h" NSString * const NSStreamDataWrittenToMemoryStreamKey = @"NSStreamDataWrittenToMemoryStreamKey"; @@ -364,7 +365,7 @@ static RunLoopEventType typeForStream(NSStream *aStream) theError = [NSError errorWithDomain: NSPOSIXErrorDomain code: errno userInfo: nil]; - NSLog(@"%@ error(%d): - %s", self, errno, GSLastErrorStr(errno)); + NSLog(@"%@ error(%d): - %@", self, errno, [_GSPrivate error]); ASSIGN(_lastError, theError); _currentStatus = NSStreamStatusError; } diff --git a/Source/GSString.m b/Source/GSString.m index 823ee356a..4a6acf133 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -52,12 +52,15 @@ #include "GSPrivate.h" -extern BOOL GSEncodingSupported(NSStringEncoding enc); - /* memcpy(), strlen(), strcmp() are gcc builtin's */ #include "GNUstepBase/Unicode.h" +static BOOL isByteEncoding(NSStringEncoding enc) +{ + return [_GSPrivate isByteEncoding: enc]; +} + #ifdef NeXT_RUNTIME /* Used by the Darwin/NeXT ObjC Runtime until Apple Radar 2870817 is fixed. */ @@ -249,10 +252,18 @@ setup(void) if (beenHere == NO) { - extern NSStringEncoding GetDefEncoding(void); - beenHere = YES; + /* + * Cache the default string encoding, and set the internal encoding + * used by 8-bit character strings to match if possible. + */ + externalEncoding = [_GSPrivate defaultCStringEncoding]; + if (isByteEncoding(externalEncoding) == YES) + { + internalEncoding = externalEncoding; + } + /* * Cache pointers to classes to work round misfeature in * GNU compiler/runtime system where class lookup is very slow. @@ -290,16 +301,6 @@ setup(void) caiSel = @selector(characterAtIndex:); gcrSel = @selector(getCharacters:range:); ranSel = @selector(rangeOfComposedCharacterSequenceAtIndex:); - - /* - * Cache the default string encoding, and set the internal encoding - * used by 8-bit character strings to match if possible. - */ - externalEncoding = GetDefEncoding(); - if (GSIsByteEncoding(externalEncoding) == YES) - { - internalEncoding = externalEncoding; - } } } @@ -450,7 +451,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree, void *chars = 0; BOOL flag = NO; - if (GSEncodingSupported(encoding) == NO) + if ([_GSPrivate isEncodingSupported: encoding] == NO) { return nil; // Invalid encoding } @@ -493,7 +494,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree, BOOL isLatin1 = NO; GSStr me; - if (GSEncodingSupported(encoding) == NO) + if ([_GSPrivate isEncodingSupported: encoding] == NO) { if (flag == YES && bytes != 0) { @@ -535,7 +536,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree, encoding = internalEncoding; } } - else if (encoding != internalEncoding && GSIsByteEncoding(encoding) == YES) + else if (encoding != internalEncoding && isByteEncoding(encoding) == YES) { unsigned i; @@ -1025,7 +1026,7 @@ canBeConvertedToEncoding_c(GSStr self, NSStringEncoding enc) && enc != internalEncoding && enc != NSUTF8StringEncoding && enc != NSUnicodeStringEncoding - && ((internalEncoding != NSASCIIStringEncoding) || !GSIsByteEncoding(enc))) + && ((internalEncoding != NSASCIIStringEncoding) || !isByteEncoding(enc))) { unsigned l = 0; unichar *r = 0; @@ -1403,7 +1404,7 @@ dataUsingEncoding_c(GSStr self, NSStringEncoding encoding, BOOL lossy) if ((encoding == internalEncoding) || ((internalEncoding == NSASCIIStringEncoding) - && (encoding == NSUTF8StringEncoding || GSIsByteEncoding(encoding)))) + && (encoding == NSUTF8StringEncoding || isByteEncoding(encoding)))) { unsigned char *buff; @@ -1787,7 +1788,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength, } if (enc == NSUTF8StringEncoding - && GSIsByteEncoding(internalEncoding)) + && isByteEncoding(internalEncoding)) { unsigned i; @@ -1822,7 +1823,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength, } if (enc == NSASCIIStringEncoding - && GSIsByteEncoding(internalEncoding)) + && isByteEncoding(internalEncoding)) { unsigned i; @@ -3759,7 +3760,7 @@ NSAssert(_flags.free == 1 && _zone != 0, NSInternalInconsistencyException); encoding = internalEncoding; } } - else if (encoding != internalEncoding && GSIsByteEncoding(encoding) == YES) + else if (encoding != internalEncoding && isByteEncoding(encoding) == YES) { unsigned i; @@ -5078,44 +5079,7 @@ void GSStrAppendUnichars(GSStr s, const unichar *u, unsigned l) } } -void GSStrAppendUnichar(GSStr s, unichar u) -{ - /* - * Make the string wide if necessary. - */ - if (s->_flags.wide == 0) - { - if (u > 255 || (u > 127 && internalEncoding != NSISOLatin1StringEncoding)) - { - GSStrWiden(s); - } - } - /* - * Make room for the characters we are appending. - */ - if (s->_count + 2 >= s->_capacity) - { - GSStrMakeSpace(s, 1); - } - - /* - * Copy the characters into place. - */ - if (s->_flags.wide == 1) - { - s->_contents.u[s->_count++] = u; - } - else - { - s->_contents.c[s->_count++] = u; - } -} - -/* - * Make the content of this string into unicode if it is not in - * the external defaults C string encoding. - */ void GSStrExternalize(GSStr s) { if (s->_flags.wide == 0 && internalEncoding != externalEncoding) diff --git a/Source/NSArchiver.m b/Source/NSArchiver.m index a4fd51e5b..b8d3da645 100644 --- a/Source/NSArchiver.m +++ b/Source/NSArchiver.m @@ -858,7 +858,7 @@ static Class NSMutableDataMallocClass; if (node) { c = (Class)node->value.ptr; - return [NSString stringWithCString: GSNameFromClass(c)]; + return [NSString stringWithUTF8String: GSNameFromClass(c)]; } } return trueName; diff --git a/Source/NSArray.m b/Source/NSArray.m index 3d7c5a58d..5d3227c76 100644 --- a/Source/NSArray.m +++ b/Source/NSArray.m @@ -1202,7 +1202,7 @@ compare(id elem1, id elem2, void* context) */ - (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile { - NSDictionary *loc = GSUserDefaultsDictionaryRepresentation(); + NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation]; NSString *desc = nil; NSData *data; @@ -1228,7 +1228,7 @@ compare(id elem1, id elem2, void* context) */ - (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile { - NSDictionary *loc = GSUserDefaultsDictionaryRepresentation(); + NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation]; NSString *desc = nil; NSData *data; diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 4373e495e..a802f2c5c 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -50,7 +50,7 @@ #include "Foundation/NSPathUtilities.h" #include "Foundation/NSData.h" #include "Foundation/NSValue.h" -#include "GNUstepBase/GSFunctions.h" + #ifdef HAVE_UNISTD_H #include #endif @@ -226,7 +226,7 @@ static NSString *ExecutablePath() #ifdef PROCFS_EXE_LINK executablePath = [[NSFileManager defaultManager] pathContentOfSymbolicLinkAtPath: - [NSString stringWithCString: PROCFS_EXE_LINK]]; + [NSString stringWithUTF8String: PROCFS_EXE_LINK]]; /* On some systems, the link is of the form "[device]:inode", which @@ -377,11 +377,29 @@ _bundle_name_first_match(NSString* directory, NSString* name) static inline NSString * _find_framework(NSString *name) { - NSArray *paths; + NSArray *paths; + NSFileManager *file_mgr = [NSFileManager defaultManager]; + NSString *file_name; + NSString *file_path; + NSString *path; + NSEnumerator *enumerator; + NSCParameterAssert(name != nil); + paths = NSSearchPathForDirectoriesInDomains(GSFrameworksDirectory, NSAllDomainsMask,YES); - return GSFindNamedFile(paths, name, @"framework"); + + enumerator = [paths objectEnumerator]; + while ((path = [enumerator nextObject])) + { + file_path = [path stringByAppendingPathComponent: file_name]; + + if ([file_mgr fileExistsAtPath: file_path] == YES) + { + return file_path; // Found it! + } + } + return nil; } @interface NSBundle (Private) @@ -464,8 +482,9 @@ _find_framework(NSString *name) && !strncmp ("NSFramework_", frameworkClass->name, 12)) { /* The name of the framework. */ - NSString *name = [NSString stringWithCString: &frameworkClass->name[12]]; + NSString *name; + name = [NSString stringWithUTF8String: &frameworkClass->name[12]]; /* Important - gnustep-make mangles framework names to encode * them as ObjC class names. Here we need to demangle them. We * apply the reverse transformations in the reverse order. diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index 25c57a3ba..484e0c897 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -653,7 +653,7 @@ static inline int getDigits(const char *from, char *to, int limit) sourceLen = strlen(source); if (locale == nil) { - locale = GSUserDefaultsDictionaryRepresentation(); + locale = [_GSPrivate userDefaultsDictionaryRepresentation]; } if (fmt == nil) { @@ -1064,7 +1064,7 @@ static inline int getDigits(const char *from, char *to, int limit) NSString *currAMPM; NSArray *amPMNames; - currAMPM = [NSString stringWithCString: tmpStr]; + currAMPM = [NSString stringWithUTF8String: tmpStr]; amPMNames = [locale objectForKey: NSAMPMDesignation]; /* @@ -1170,7 +1170,7 @@ static inline int getDigits(const char *from, char *to, int limit) tmpStr[tmpIdx - sourceIdx] = '\0'; sourceIdx += tmpIdx - sourceIdx; { - NSString *z = [NSString stringWithCString: tmpStr]; + NSString *z = [NSString stringWithUTF8String: tmpStr]; /* Abbreviations aren't one-to-one with time zone names so just look for the zone named after the abbreviation, @@ -2191,7 +2191,7 @@ static void Grow(DescriptionInfo *info, unsigned size) DescriptionInfo info; if (locale == nil) - locale = GSUserDefaultsDictionaryRepresentation(); + locale = [_GSPrivate userDefaultsDictionaryRepresentation]; if (format == nil) format = [locale objectForKey: NSTimeDateFormatString]; diff --git a/Source/NSData.m b/Source/NSData.m index 5de22d4fe..e16bd489d 100644 --- a/Source/NSData.m +++ b/Source/NSData.m @@ -80,6 +80,7 @@ #include "Foundation/NSRange.h" #include "Foundation/NSURL.h" #include "Foundation/NSZone.h" +#include "GSPrivate.h" #include #include /* for memset() */ #ifdef HAVE_UNISTD_H @@ -163,8 +164,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) if (theFile == 0) /* We failed to open the file. */ { - NSWarnFLog(@"Open (%@) attempt failed - %s", path, - GSLastErrorStr(errno)); + NSWarnFLog(@"Open (%@) attempt failed - %@", path, [_GSPrivate error]); goto failure; } @@ -174,8 +174,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) c = fseek(theFile, 0L, SEEK_END); if (c != 0) { - NSWarnFLog(@"Seek to end of file (%@) failed - %s", path, - GSLastErrorStr(errno)); + NSWarnFLog(@"Seek to end of file (%@) failed - %@", path, + [_GSPrivate error]); goto failure; } @@ -186,8 +186,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) fileLength = ftell(theFile); if (fileLength == -1) { - NSWarnFLog(@"Ftell on %@ failed - %s", path, - GSLastErrorStr(errno)); + NSWarnFLog(@"Ftell on %@ failed - %@", path, [_GSPrivate error]); goto failure; } @@ -198,8 +197,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) c = fseek(theFile, 0L, SEEK_SET); if (c != 0) { - NSWarnFLog(@"Fseek to start of file (%@) failed - %s", path, - GSLastErrorStr(errno)); + NSWarnFLog(@"Fseek to start of file (%@) failed - %@", path, + [_GSPrivate error]); goto failure; } @@ -224,8 +223,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) } if (tmp == 0) { - NSLog(@"Malloc failed for file (%@) of length %d - %s", path, - fileLength + c, GSLastErrorStr(errno)); + NSLog(@"Malloc failed for file (%@) of length %d - %@", path, + fileLength + c, [_GSPrivate error]); goto failure; } memcpy(tmp + fileLength, buf, c); @@ -237,16 +236,16 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) tmp = NSZoneMalloc(zone, fileLength); if (tmp == 0) { - NSLog(@"Malloc failed for file (%@) of length %d - %s", path, - fileLength, GSLastErrorStr(errno)); + NSLog(@"Malloc failed for file (%@) of length %d - %@", path, + fileLength, [_GSPrivate error]); goto failure; } c = fread(tmp, 1, fileLength, theFile); if (c != (int)fileLength) { - NSWarnFLog(@"read of file (%@) contents failed - %s", path, - GSLastErrorStr(errno)); + NSWarnFLog(@"read of file (%@) contents failed - %@", path, + [_GSPrivate error]); goto failure; } } @@ -852,8 +851,7 @@ failure: strcat(thePath, "XXXXXX"); if ((desc = mkstemp(thePath)) < 0) { - NSWarnMLog(@"mkstemp (%s) failed - %s", thePath, - GSLastErrorStr(errno)); + NSWarnMLog(@"mkstemp (%s) failed - %@", thePath, [_GSPrivate error]); goto failure; } mask = umask(0); @@ -880,9 +878,9 @@ failure: wcscat(wthePath, L"XXXXXX"); if (_wmktemp(wthePath) == 0) { - NSWarnMLog(@"mktemp (%@) failed - %s", - [NSString stringWithCharacters:wthePath length:wcslen(wthePath)], - GSLastErrorStr(errno)); + NSWarnMLog(@"mktemp (%@) failed - %@", + [NSString stringWithCharacters: wthePath length: wcslen(wthePath)], + [_GSPrivate error]); goto failure; } #else @@ -890,8 +888,7 @@ failure: strcat(thePath, "XXXXXX"); if (mktemp(thePath) == 0) { - NSWarnMLog(@"mktemp (%s) failed - %s", thePath, - GSLastErrorStr(errno)); + NSWarnMLog(@"mktemp (%s) failed - %@", thePath, [_GSPrivate error]); goto failure; } #endif @@ -918,11 +915,11 @@ failure: /* Something went wrong; we weren't * even able to open the file. */ #if defined(__MINGW32__) - NSWarnMLog(@"Open (%@) failed - %s", + NSWarnMLog(@"Open (%@) failed - %@", [NSString stringWithCharacters: wthePath length: wcslen(wthePath)], - GSLastErrorStr(errno)); + [_GSPrivate error]); #else - NSWarnMLog(@"Open (%s) failed - %s", thePath, GSLastErrorStr(errno)); + NSWarnMLog(@"Open (%s) failed - %@", thePath, [_GSPrivate error]); #endif goto failure; } @@ -936,11 +933,11 @@ failure: * some reason. */ { #if defined(__MINGW32__) - NSWarnMLog(@"Fwrite (%@) failed - %s", - [NSString stringWithCharacters:wthePath length:wcslen(wthePath)], - GSLastErrorStr(errno)); + NSWarnMLog(@"Fwrite (%@) failed - %@", + [NSString stringWithCharacters: wthePath length: wcslen(wthePath)], + [_GSPrivate error]); #else - NSWarnMLog(@"Fwrite (%s) failed - %s", thePath, GSLastErrorStr(errno)); + NSWarnMLog(@"Fwrite (%s) failed - %@", thePath, [_GSPrivate error]); #endif goto failure; } @@ -953,11 +950,11 @@ failure: * so we need to deal with it. */ { #if defined(__MINGW32__) - NSWarnMLog(@"Fclose (%@) failed - %s", - [NSString stringWithCharacters:wthePath length:wcslen(wthePath)], - GSLastErrorStr(errno)); + NSWarnMLog(@"Fclose (%@) failed - %@", + [NSString stringWithCharacters: wthePath length: wcslen(wthePath)], + [_GSPrivate error]); #else - NSWarnMLog(@"Fclose (%s) failed - %s", thePath, GSLastErrorStr(errno)); + NSWarnMLog(@"Fclose (%s) failed - %@", thePath, [_GSPrivate error]); #endif goto failure; } @@ -1038,14 +1035,15 @@ failure: if (c != 0) /* Many things could go wrong, I guess. */ { #if defined(__MINGW32__) - NSWarnMLog(@"Rename ('%@' to '%@') failed - %s", - [NSString stringWithCharacters: wthePath length:wcslen(wthePath)], - [NSString stringWithCharacters: - wtheRealPath length:wcslen(wtheRealPath)], - GSLastErrorStr(errno)); + NSWarnMLog(@"Rename ('%@' to '%@') failed - %@", + [NSString stringWithCharacters: wthePath + length: wcslen(wthePath)], + [NSString stringWithCharacters: wtheRealPath + length: wcslen(wtheRealPath)], + [_GSPrivate error]); #else - NSWarnMLog(@"Rename ('%s' to '%s') failed - %s", - thePath, theRealPath, GSLastErrorStr(errno)); + NSWarnMLog(@"Rename ('%s' to '%s') failed - %@", + thePath, theRealPath, [_GSPrivate error]); #endif goto failure; } @@ -2918,7 +2916,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) #endif if (fd < 0) { - NSWarnMLog(@"unable to open %@ - %s", path, GSLastErrorStr(errno)); + NSWarnMLog(@"unable to open %@ - %@", path, [_GSPrivate error]); RELEASE(self); return nil; } @@ -2926,7 +2924,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) length = lseek(fd, 0, SEEK_END); if (length < 0) { - NSWarnMLog(@"unable to seek to eof %@ - %s", path, GSLastErrorStr(errno)); + NSWarnMLog(@"unable to seek to eof %@ - %@", path, [_GSPrivate error]); close(fd); RELEASE(self); return nil; @@ -2934,7 +2932,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) /* Position at start of file. */ if (lseek(fd, 0, SEEK_SET) != 0) { - NSWarnMLog(@"unable to seek to sof %@ - %s", path, GSLastErrorStr(errno)); + NSWarnMLog(@"unable to seek to sof %@ - %@", path, [_GSPrivate error]); close(fd); RELEASE(self); return nil; @@ -2942,7 +2940,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) bytes = mmap(0, length, PROT_READ, MAP_SHARED, fd, 0); if (bytes == MAP_FAILED) { - NSWarnMLog(@"mapping failed for %s - %s", path, GSLastErrorStr(errno)); + NSWarnMLog(@"mapping failed for %s - %@", path, [_GSPrivate error]); close(fd); RELEASE(self); self = [dataMalloc allocWithZone: NSDefaultMallocZone()]; @@ -2969,15 +2967,15 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) struct shmid_ds buf; if (shmctl(shmid, IPC_STAT, &buf) < 0) - NSLog(@"[NSDataShared -dealloc] shared memory control failed - %s", - GSLastErrorStr(errno)); + NSLog(@"[NSDataShared -dealloc] shared memory control failed - %@", + [_GSPrivate error]); else if (buf.shm_nattch == 1) if (shmctl(shmid, IPC_RMID, &buf) < 0) /* Mark for deletion. */ - NSLog(@"[NSDataShared -dealloc] shared memory delete failed - %s", - GSLastErrorStr(errno)); + NSLog(@"[NSDataShared -dealloc] shared memory delete failed - %@", + [_GSPrivate error]); if (shmdt(bytes) < 0) - NSLog(@"[NSDataShared -dealloc] shared memory detach failed - %s", - GSLastErrorStr(errno)); + NSLog(@"[NSDataShared -dealloc] shared memory detach failed - %@", + [_GSPrivate error]); bytes = 0; length = 0; shmid = -1; @@ -2993,8 +2991,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) shmid = shmget(IPC_PRIVATE, bufferSize, IPC_CREAT|VM_RDONLY); if (shmid == -1) /* Created memory? */ { - NSLog(@"[-initWithBytes:length:] shared mem get failed for %u - %s", - bufferSize, GSLastErrorStr(errno)); + NSLog(@"[-initWithBytes:length:] shared mem get failed for %u - %@", + bufferSize, [_GSPrivate error]); RELEASE(self); self = [dataMalloc allocWithZone: NSDefaultMallocZone()]; return [self initWithBytes: aBuffer length: bufferSize]; @@ -3003,8 +3001,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) bytes = shmat(shmid, 0, 0); if (bytes == (void*)-1) { - NSLog(@"[-initWithBytes:length:] shared mem attach failed for %u - %s", - bufferSize, GSLastErrorStr(errno)); + NSLog(@"[-initWithBytes:length:] shared mem attach failed for %u - %@", + bufferSize, [_GSPrivate error]); bytes = 0; RELEASE(self); self = [dataMalloc allocWithZone: NSDefaultMallocZone()]; @@ -3022,21 +3020,23 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) shmid = anId; if (shmctl(shmid, IPC_STAT, &buf) < 0) { - NSLog(@"[NSDataShared -initWithShmID:length:] shared memory control failed - %s", GSLastErrorStr(errno)); + NSLog(@"[NSDataShared -initWithShmID:length:] shared memory " + @"control failed - %@", [_GSPrivate error]); RELEASE(self); /* Unable to access memory. */ return nil; } if (buf.shm_segsz < bufferSize) { - NSLog(@"[NSDataShared -initWithShmID:length:] shared memory segment too small"); + NSLog(@"[NSDataShared -initWithShmID:length:] shared memory " + @"segment too small"); RELEASE(self); /* Memory segment too small. */ return nil; } bytes = shmat(shmid, 0, 0); if (bytes == (void*)-1) { - NSLog(@"[NSDataShared -initWithShmID:length:] shared memory attach failed - %s", - GSLastErrorStr(errno)); + NSLog(@"[NSDataShared -initWithShmID:length:] shared memory " + @"attach failed - %s", [_GSPrivate error]); bytes = 0; RELEASE(self); /* Unable to attach to memory. */ return nil; @@ -3162,7 +3162,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) if (bytes == 0) { NSLog(@"[NSMutableDataMalloc -initWithCapacity:] out of memory " - @"for %u bytes - %s", size, GSLastErrorStr(errno)); + @"for %u bytes - %@", size, [_GSPrivate error]); RELEASE(self); return nil; } @@ -3658,20 +3658,20 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) if (shmctl(shmid, IPC_STAT, &buf) < 0) { NSLog(@"[NSMutableDataShared -dealloc] shared memory " - @"control failed - %s", GSLastErrorStr(errno)); + @"control failed - %@", [_GSPrivate error]); } else if (buf.shm_nattch == 1) { if (shmctl(shmid, IPC_RMID, &buf) < 0) /* Mark for deletion. */ { NSLog(@"[NSMutableDataShared -dealloc] shared memory " - @"delete failed - %s", GSLastErrorStr(errno)); + @"delete failed - %@", [_GSPrivate error]); } } if (shmdt(bytes) < 0) { NSLog(@"[NSMutableDataShared -dealloc] shared memory " - @"detach failed - %s", GSLastErrorStr(errno)); + @"detach failed - %@", [_GSPrivate error]); } bytes = 0; length = 0; @@ -3695,24 +3695,21 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) - (id) initWithCapacity: (unsigned int)bufferSize { - int e; - shmid = shmget(IPC_PRIVATE, bufferSize, IPC_CREAT|VM_ACCESS); if (shmid == -1) /* Created memory? */ { NSLog(@"[NSMutableDataShared -initWithCapacity:] shared memory " - @"get failed for %u - %s", bufferSize, GSLastErrorStr(errno)); + @"get failed for %u - %@", bufferSize, [_GSPrivate error]); RELEASE(self); self = [mutableDataMalloc allocWithZone: NSDefaultMallocZone()]; return [self initWithCapacity: bufferSize]; } bytes = shmat(shmid, 0, 0); - e = errno; if (bytes == (void*)-1) { NSLog(@"[NSMutableDataShared -initWithCapacity:] shared memory " - @"attach failed for %u - %s", bufferSize, GSLastErrorStr(e)); + @"attach failed for %u - %@", bufferSize, [_GSPrivate error]); bytes = 0; RELEASE(self); self = [mutableDataMalloc allocWithZone: NSDefaultMallocZone()]; @@ -3732,7 +3729,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) if (shmctl(shmid, IPC_STAT, &buf) < 0) { NSLog(@"[NSMutableDataShared -initWithShmID:length:] shared memory " - @"control failed - %s", GSLastErrorStr(errno)); + @"control failed - %@", [_GSPrivate error]); RELEASE(self); /* Unable to access memory. */ return nil; } @@ -3747,7 +3744,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) if (bytes == (void*)-1) { NSLog(@"[NSMutableDataShared -initWithShmID:length:] shared memory " - @"attach failed - %s", GSLastErrorStr(errno)); + @"attach failed - %@", [_GSPrivate error]); bytes = 0; RELEASE(self); /* Unable to attach to memory. */ return nil; @@ -3769,8 +3766,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) if (newid == -1) /* Created memory? */ { [NSException raise: NSMallocException - format: @"Unable to create shared memory segment (size:%u) - %s.", - size, GSLastErrorStr(errno)]; + format: @"Unable to create shared memory segment (size:%u) - %@.", + size, [_GSPrivate error]]; } tmp = shmat(newid, 0, 0); if ((intptr_t)tmp == -1) /* Attached memory? */ @@ -3786,20 +3783,20 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) if (shmctl(shmid, IPC_STAT, &buf) < 0) { NSLog(@"[NSMutableDataShared -setCapacity:] shared memory " - @"control failed - %s", GSLastErrorStr(errno)); + @"control failed - %@", [_GSPrivate error]); } else if (buf.shm_nattch == 1) { if (shmctl(shmid, IPC_RMID, &buf) < 0) /* Mark for deletion. */ { NSLog(@"[NSMutableDataShared -setCapacity:] shared memory " - @"delete failed - %s", GSLastErrorStr(errno)); + @"delete failed - %@", [_GSPrivate error]); } } if (shmdt(bytes) < 0) /* Detach memory. */ { NSLog(@"[NSMutableDataShared -setCapacity:] shared memory " - @"detach failed - %s", GSLastErrorStr(errno)); + @"detach failed - %@", [_GSPrivate error]); } } bytes = tmp; diff --git a/Source/NSDate.m b/Source/NSDate.m index 219a7d1d1..4b71807d9 100644 --- a/Source/NSDate.m +++ b/Source/NSDate.m @@ -264,7 +264,7 @@ otherTime(NSDate* other) if (locale == nil) { - locale = GSUserDefaultsDictionaryRepresentation(); + locale = [_GSPrivate userDefaultsDictionaryRepresentation]; } ws = [NSCharacterSet whitespaceAndNewlineCharacterSet]; digits = [NSCharacterSet decimalDigitCharacterSet]; diff --git a/Source/NSDateFormatter.m b/Source/NSDateFormatter.m index 4731978fb..af8a00599 100644 --- a/Source/NSDateFormatter.m +++ b/Source/NSDateFormatter.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSDateFormatter class reference $Date$ $Revision$ diff --git a/Source/NSDebug.m b/Source/NSDebug.m index ff076fd15..09f00df1e 100644 --- a/Source/NSDebug.m +++ b/Source/NSDebug.m @@ -957,6 +957,7 @@ const char *_NSPrintForDebugger(id object) NSString *_NSNewStringFromCString(const char *cstring) { - return [NSString stringWithCString: cstring]; + return [NSString stringWithCString: cstring + encoding: [NSString defaultCStringEncoding]]; } diff --git a/Source/NSDecimal.m b/Source/NSDecimal.m index fbac74d23..5df723410 100644 --- a/Source/NSDecimal.m +++ b/Source/NSDecimal.m @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSDecimal class reference $Date$ $Revision$ diff --git a/Source/NSDecimalNumber.m b/Source/NSDecimalNumber.m index de1767071..db54b29df 100644 --- a/Source/NSDecimalNumber.m +++ b/Source/NSDecimalNumber.m @@ -19,7 +19,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSDecimalNumber class reference $Date$ $Revision$ @@ -260,7 +261,7 @@ static NSDecimalNumber *one; - (id) initWithString: (NSString*)numberValue { return [self initWithString: numberValue - locale: GSUserDefaultsDictionaryRepresentation()]; + locale: [_GSPrivate userDefaultsDictionaryRepresentation]]; } - (id) initWithString: (NSString*)numberValue diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index 3315f1334..533638d89 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -929,7 +929,7 @@ compareIt(id o1, id o2, void* context) */ - (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile { - NSDictionary *loc = GSUserDefaultsDictionaryRepresentation(); + NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation]; NSString *desc = nil; NSData *data; @@ -954,7 +954,7 @@ compareIt(id o1, id o2, void* context) */ - (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile { - NSDictionary *loc = GSUserDefaultsDictionaryRepresentation(); + NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation]; NSString *desc = nil; NSData *data; diff --git a/Source/NSDistributedLock.m b/Source/NSDistributedLock.m index 004f2647a..8d136ee6f 100644 --- a/Source/NSDistributedLock.m +++ b/Source/NSDistributedLock.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSDistributedLock class reference $Date$ $Revision$ @@ -31,6 +32,7 @@ #include "Foundation/NSException.h" #include "Foundation/NSValue.h" #include "Foundation/NSDebug.h" +#include "GSPrivate.h" #include @@ -76,13 +78,13 @@ static NSFileManager *mgr = nil; if ([mgr removeFileAtPath: _lockPath handler: nil] == NO) { - const char *err = GSLastErrorStr(errno); + NSString *err = [_GSPrivate error]; attributes = [mgr fileAttributesAtPath: _lockPath traverseLink: YES]; if ([modDate isEqual: [attributes fileModificationDate]] == YES) { [NSException raise: NSGenericException - format: @"Failed to remove lock directory '%@' - %s", + format: @"Failed to remove lock directory '%@' - %@", _lockPath, err]; } } @@ -201,8 +203,8 @@ static NSFileManager *mgr = nil; attributes: attributesToSet]; if (locked == NO) { - NSLog(@"Failed to create lock directory '%@' - %s", - _lockPath, GSLastErrorStr(errno)); + NSLog(@"Failed to create lock directory '%@' - %@", + _lockPath, [_GSPrivate error]); } } } @@ -257,8 +259,8 @@ static NSFileManager *mgr = nil; if ([mgr removeFileAtPath: _lockPath handler: nil] == NO) { [NSException raise: NSGenericException - format: @"Failed to remove lock directory '%@' - %s", - _lockPath, GSLastErrorStr(errno)]; + format: @"Failed to remove lock directory '%@' - %@", + _lockPath, [_GSPrivate error]]; } } else diff --git a/Source/NSException.m b/Source/NSException.m index 5160a9aab..a4516adcb 100644 --- a/Source/NSException.m +++ b/Source/NSException.m @@ -353,8 +353,9 @@ static void find_address (bfd *abfd, asection *section, fi = [GSFunctionInfo alloc]; fi = [fi initWithModule: info->module address: info->theAddress - file: [NSString stringWithCString: fileName] - function: [NSString stringWithCString: functionName] + file: [NSString stringWithCString: fileName + encoding: [NSString defaultCStringEncoding]] + function: [NSString stringWithUTF8String: functionName] line: line]; [fi autorelease]; info->theInfo = fi; @@ -584,7 +585,8 @@ static void _terminate() #else shouldAbort = NO; // exit() by default. #endif - shouldAbort = GSEnvironmentFlag("CRASH_ON_ABORT", shouldAbort); + shouldAbort = [_GSPrivate environmentFlag: "CRASH_ON_ABORT" + defaultValue: shouldAbort]; if (shouldAbort == YES) { abort(); @@ -598,9 +600,8 @@ static void _terminate() static void _NSFoundationUncaughtExceptionHandler (NSException *exception) { - extern const char* GSArgZero(void); - - fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n", GSArgZero(), + fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n", + [_GSPrivate argZero], [[exception name] lossyCString], [[exception reason] lossyCString]); fflush(stderr); /* NEEDED UNDER MINGW */ diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index 72dc3ad0c..bd376d732 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -401,8 +401,8 @@ static NSStringEncoding defaultEncoding; { allOk = NO; str = [NSString stringWithFormat: - @"Unable to change NSFileOwnerAccountID to '%u' - %s", - num, GSLastErrorStr(errno)]; + @"Unable to change NSFileOwnerAccountID to '%u' - %@", + num, [_GSPrivate error]]; ASSIGN(_lastError, str); } } @@ -425,8 +425,8 @@ static NSStringEncoding defaultEncoding; { allOk = NO; str = [NSString stringWithFormat: - @"Unable to change NSFileOwnerAccountName to '%@' - %s", - str, GSLastErrorStr(errno)]; + @"Unable to change NSFileOwnerAccountName to '%@' - %@", + str, [_GSPrivate error]]; ASSIGN(_lastError, str); } } @@ -439,8 +439,8 @@ static NSStringEncoding defaultEncoding; { allOk = NO; str = [NSString stringWithFormat: - @"Unable to change NSFileGroupOwnerAccountID to '%u' - %s", - num, GSLastErrorStr(errno)]; + @"Unable to change NSFileGroupOwnerAccountID to '%u' - %@", + num, [_GSPrivate error]]; ASSIGN(_lastError, str); } } @@ -461,8 +461,8 @@ static NSStringEncoding defaultEncoding; { allOk = NO; str = [NSString stringWithFormat: - @"Unable to change NSFileGroupOwnerAccountName to '%@' - %s", - str, GSLastErrorStr(errno)]; + @"Unable to change NSFileGroupOwnerAccountName to '%@' - %@", + str, [_GSPrivate error]]; ASSIGN(_lastError, str); } } @@ -475,8 +475,8 @@ static NSStringEncoding defaultEncoding; { allOk = NO; str = [NSString stringWithFormat: - @"Unable to change NSFilePosixPermissions to '%o' - %s", - num, GSLastErrorStr(errno)]; + @"Unable to change NSFilePosixPermissions to '%o' - %@", + num, [_GSPrivate error]]; ASSIGN(_lastError, str); } } @@ -519,8 +519,8 @@ static NSStringEncoding defaultEncoding; { allOk = NO; str = [NSString stringWithFormat: - @"Unable to change NSFileModificationDate to '%@' - %s", - date, GSLastErrorStr(errno)]; + @"Unable to change NSFileModificationDate to '%@' - %@", + date, [_GSPrivate error]]; ASSIGN(_lastError, str); } } @@ -747,8 +747,8 @@ static NSStringEncoding defaultEncoding; { NSString *s; - s = [NSString stringWithFormat: @"Could not create '%s' - '%s'", - dirpath, GSLastErrorStr(errno)]; + s = [NSString stringWithFormat: @"Could not create '%s' - '%@'", + dirpath, [_GSPrivate error]]; ASSIGN(_lastError, s); return NO; } @@ -1278,8 +1278,8 @@ static NSStringEncoding defaultEncoding; #endif { return [self _proceedAccordingToHandler: handler - forError: [NSString stringWithCString: GSLastErrorStr (errno)] - inPath: path]; + forError: [_GSPrivate error] + inPath: path]; } else { @@ -1312,8 +1312,8 @@ static NSStringEncoding defaultEncoding; if (_RMDIR([self fileSystemRepresentationWithPath: path]) < 0) { return [self _proceedAccordingToHandler: handler - forError: [NSString stringWithCString: GSLastErrorStr (errno)] - inPath: path]; + forError: [_GSPrivate error] + inPath: path]; } else { @@ -2031,8 +2031,8 @@ inline void gsedRelease(GSEnumeratedDirectory X) } else { - NSLog(@"Failed to recurse into directory '%@' - %s", path, - GSLastErrorStr(errno)); + NSLog(@"Failed to recurse into directory '%@' - %@", path, + [_GSPrivate error]); } return self; } @@ -2198,8 +2198,8 @@ inline void gsedRelease(GSEnumeratedDirectory X) } else { - NSLog(@"Failed to recurse into directory '%@' - %s", - _currentFilePath, GSLastErrorStr(errno)); + NSLog(@"Failed to recurse into directory '%@' - %@", + _currentFilePath, [_GSPrivate error]); } } } @@ -2940,7 +2940,8 @@ static NSSet *fileKeys = nil; gp = getgrgid(statbuf.st_gid); if (gp != 0) { - group = [NSString stringWithCString: gp->gr_name]; + group = [NSString stringWithCString: gp->gr_name + encoding: defaultEncoding]; } #endif #endif @@ -3081,7 +3082,8 @@ static NSSet *fileKeys = nil; if (pw != 0) { - owner = [NSString stringWithCString: pw->pw_name]; + owner = [NSString stringWithCString: pw->pw_name + encoding: defaultEncoding]; } #endif /* HAVE_PWD_H */ #endif diff --git a/Source/NSHost.m b/Source/NSHost.m index 2528d1063..af392e97e 100644 --- a/Source/NSHost.m +++ b/Source/NSHost.m @@ -204,7 +204,7 @@ static NSMutableDictionary *_hostCache = nil; break; } - h_name = [NSString stringWithCString: entry->h_name]; + h_name = [NSString stringWithUTF8String: entry->h_name]; [names addObject: h_name]; if (entry->h_aliases != 0) @@ -212,7 +212,7 @@ static NSMutableDictionary *_hostCache = nil; i = 0; while ((ptr = entry->h_aliases[i++]) != 0) { - [names addObject: [NSString stringWithCString: ptr]]; + [names addObject: [NSString stringWithUTF8String: ptr]]; } } if (entry->h_addr_list != 0) @@ -223,7 +223,7 @@ static NSMutableDictionary *_hostCache = nil; NSString *addr; memcpy((void*)&in.s_addr, (const void*)ptr, entry->h_length); - addr = [NSString stringWithCString: (char*)inet_ntoa(in)]; + addr = [NSString stringWithUTF8String: (char*)inet_ntoa(in)]; [addresses addObject: addr]; } } diff --git a/Source/NSInvocation.m b/Source/NSInvocation.m index 5b9b05d40..32b2b5d38 100644 --- a/Source/NSInvocation.m +++ b/Source/NSInvocation.m @@ -648,13 +648,13 @@ _arg_addr(NSInvocation *inv, int index) char buffer[1024]; snprintf (buffer, 1024, "<%s %p selector: %s target: %s>", \ - GSClassNameFromObject(self), \ - self, \ - _selector ? GSNameFromSelector(_selector) : "nil", \ - _target ? GSNameFromClass([_target class]) : "nil" \ - ); + GSClassNameFromObject(self), \ + self, \ + _selector ? GSNameFromSelector(_selector) : "nil", \ + _target ? GSNameFromClass([_target class]) : "nil" \ + ); - return [NSString stringWithCString: buffer]; + return [NSString stringWithUTF8String: buffer]; } - (void) encodeWithCoder: (NSCoder*)aCoder diff --git a/Source/NSKeyedArchiver.m b/Source/NSKeyedArchiver.m index 128d6e287..91b4171fd 100644 --- a/Source/NSKeyedArchiver.m +++ b/Source/NSKeyedArchiver.m @@ -669,7 +669,7 @@ static NSDictionary *makeReference(unsigned ref) * Bizzarely MacOS-X seems to encode char* values by creating * string objects and encoding those objects! */ - o = [NSString stringWithCString: (char*)address]; + o = [NSString stringWithUTF8String: (char*)address]; [self encodeObject: o]; } return; diff --git a/Source/NSLog.m b/Source/NSLog.m index 8812cc47f..3a4d0c76b 100644 --- a/Source/NSLog.m +++ b/Source/NSLog.m @@ -144,7 +144,7 @@ _NSLog_standard_printf_handler (NSString* message) OutputDebugStringW(null_terminated_buf); - if ((GSUserDefaultsFlag(GSLogSyslog) == YES + if (([_GSPrivate userDefaultsFlag: GSLogSyslog] == YES || write(_NSLogDescriptor, buf, len) != (int)len) && !IsDebuggerPresent()) { static HANDLE eventloghandle = 0; @@ -170,7 +170,7 @@ _NSLog_standard_printf_handler (NSString* message) #else #if defined(HAVE_SYSLOG) - if (GSUserDefaultsFlag(GSLogSyslog) == YES + if ([_GSPrivate userDefaultsFlag: GSLogSyslog] == YES || write(_NSLogDescriptor, buf, len) != (int)len) { null_terminated_buf = objc_malloc (sizeof (char) * (len + 1)); @@ -302,9 +302,9 @@ NSLogv (NSString* format, va_list args) } #ifdef HAVE_SYSLOG - if (GSUserDefaultsFlag(GSLogSyslog) == YES) + if ([_GSPrivate userDefaultsFlag: GSLogSyslog] == YES) { - if (GSUserDefaultsFlag(GSLogThread) == YES) + if ([_GSPrivate userDefaultsFlag: GSLogThread] == YES) { prefix = [NSString stringWithFormat: @"[thread:%x] ", GSCurrentThread()]; @@ -317,7 +317,7 @@ NSLogv (NSString* format, va_list args) else #endif { - if (GSUserDefaultsFlag(GSLogThread) == YES) + if ([_GSPrivate userDefaultsFlag: GSLogThread] == YES) { prefix = [NSString stringWithFormat: @"%@ %@[%d,%x] ", diff --git a/Source/NSMessagePort.m b/Source/NSMessagePort.m index 9d7a6582c..db0d02903 100644 --- a/Source/NSMessagePort.m +++ b/Source/NSMessagePort.m @@ -44,6 +44,7 @@ #include "Foundation/NSFileManager.h" #include "Foundation/NSProcessInfo.h" +#include "GSPrivate.h" #include "GSPortPrivate.h" #include @@ -302,15 +303,15 @@ static Class runLoopClass; e |= NBLK_OPT; if (fcntl(d, F_SETFL, e) < 0) { - NSLog(@"unable to set non-blocking mode on %d - %s", - d, GSLastErrorStr(errno)); + NSLog(@"unable to set non-blocking mode on %d - %@", + d, [_GSPrivate error]); return nil; } } else { - NSLog(@"unable to get non-blocking mode on %d - %s", - d, GSLastErrorStr(errno)); + NSLog(@"unable to get non-blocking mode on %d - %@", + d, [_GSPrivate error]); return nil; } handle = (GSMessageHandle*)NSAllocateObject(self, 0, NSDefaultMallocZone()); @@ -379,9 +380,8 @@ static Class runLoopClass; { if (errno != EINPROGRESS) { - NSLog(@"unable to make connection to %s - %s", - sockAddr.sun_path, - GSLastErrorStr(errno)); + NSLog(@"unable to make connection to %s - %@", + sockAddr.sun_path, [_GSPrivate error]); M_UNLOCK(myLock); return NO; } @@ -607,7 +607,7 @@ static Class runLoopClass; else if (errno != EINTR && errno != EAGAIN) { NSDebugMLLog(@"NSMessagePort", - @"read failed - %s on 0x%x", GSLastErrorStr(errno), self); + @"read failed - %@ on 0x%p", [_GSPrivate error], self); M_UNLOCK(myLock); [self invalidate]; return; @@ -906,7 +906,7 @@ static Class runLoopClass; && res != 0) { state = GS_H_UNCON; - NSLog(@"connect attempt failed - %s", GSLastErrorStr(res)); + NSLog(@"connect attempt failed - %@", [_GSPrivate error]); } else { @@ -922,8 +922,8 @@ static Class runLoopClass; else { state = GS_H_UNCON; - NSLog(@"connect write attempt failed - %s", - GSLastErrorStr(errno)); + NSLog(@"connect write attempt failed - %@", + [_GSPrivate error]); } RELEASE(d); } @@ -957,7 +957,7 @@ static Class runLoopClass; { if (errno != EINTR && errno != EAGAIN) { - NSLog(@"write attempt failed - %s", GSLastErrorStr(errno)); + NSLog(@"write attempt failed - %@", [_GSPrivate error]); M_UNLOCK(myLock); [self invalidate]; return; @@ -1249,7 +1249,7 @@ typedef struct { sizeof(sockAddr.sun_path)); if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); desc = -1; } else if (bind(desc, (struct sockaddr *)&sockAddr, @@ -1263,23 +1263,23 @@ typedef struct { close(desc); if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0) { - NSLog(@"unable to create socket - %s", - GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", + [_GSPrivate error]); desc = -1; } else if (bind(desc, (struct sockaddr *)&sockAddr, SUN_LEN(&sockAddr)) < 0) { - NSLog(@"unable to bind to %s - %s", - sockAddr.sun_path, GSLastErrorStr(errno)); + NSLog(@"unable to bind to %s - %@", + sockAddr.sun_path, [_GSPrivate error]); (void) close(desc); desc = -1; } } else { - NSLog(@"unable to bind to %s - %s", - sockAddr.sun_path, GSLastErrorStr(errno)); + NSLog(@"unable to bind to %s - %@", + sockAddr.sun_path, [_GSPrivate error]); (void) close(desc); desc = -1; } @@ -1291,13 +1291,13 @@ typedef struct { } else if (listen(desc, 128) < 0) { - NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno)); + NSLog(@"unable to listen on port - %@", [_GSPrivate error]); (void) close(desc); DESTROY(port); } else if (getsockname(desc, (struct sockaddr*)&sockAddr, &i) < 0) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); (void) close(desc); DESTROY(port); } @@ -1492,7 +1492,7 @@ typedef struct { sock = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC); if (sock < 0) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); } #ifndef BROKEN_SO_REUSEADDR /* @@ -1505,13 +1505,13 @@ typedef struct { sizeof(opt)) < 0) { (void)close(sock); - NSLog(@"unable to set reuse on socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to set reuse on socket - %@", [_GSPrivate error]); } #endif else if ((handle = [GSMessageHandle handleWithDescriptor: sock]) == nil) { (void)close(sock); - NSLog(@"unable to create GSMessageHandle - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create GSMessageHandle - %@", [_GSPrivate error]); } else { diff --git a/Source/NSObjCRuntime.m b/Source/NSObjCRuntime.m index 18457156d..420398935 100644 --- a/Source/NSObjCRuntime.m +++ b/Source/NSObjCRuntime.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSObjCRuntime class reference $Date$ $Revision$ @@ -40,7 +41,7 @@ NSString * NSStringFromSelector(SEL aSelector) { if (aSelector != (SEL)0) - return [NSString stringWithCString: GSNameFromSelector(aSelector)]; + return [NSString stringWithUTF8String: GSNameFromSelector(aSelector)]; return nil; } @@ -92,7 +93,7 @@ NSString * NSStringFromClass(Class aClass) { if (aClass != (Class)0) - return [NSString stringWithCString: (char*)GSNameFromClass(aClass)]; + return [NSString stringWithUTF8String: (char*)GSNameFromClass(aClass)]; return nil; } diff --git a/Source/NSObject.m b/Source/NSObject.m index 83c54b008..459ed92b2 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -161,7 +161,7 @@ static void GSLogZombie(id o, SEL sel) NSLog(@"Deallocated %@ (0x%x) sent %@", NSStringFromClass(c), o, NSStringFromSelector(sel)); } - if (GSEnvironmentFlag("CRASH_ON_ZOMBIE", NO) == YES) + if ([_GSPrivate environmentFlag: "CRASH_ON_ZOMBIE" defaultValue: NO] == YES) { abort(); } @@ -968,8 +968,10 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) zombieMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 0); zombieClass = [NSZombie class]; - NSZombieEnabled = GSEnvironmentFlag("NSZombieEnabled", NO); - NSDeallocateZombies = GSEnvironmentFlag("NSDeallocateZombies", NO); + NSZombieEnabled = [_GSPrivate environmentFlag: "NSZombieEnabled" + defaultValue: NO]; + NSDeallocateZombies = [_GSPrivate environmentFlag: "NSDeallocateZombies" + defaultValue: NO]; autorelease_class = [NSAutoreleasePool class]; autorelease_sel = @selector(addObject:); @@ -1295,7 +1297,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) { if (aSelector == 0) { - if (GSUserDefaultsFlag(GSMacOSXCompatible)) + if ([_GSPrivate userDefaultsFlag: GSMacOSXCompatible]) { [NSException raise: NSInvalidArgumentException format: @"%@ null selector given", @@ -1868,7 +1870,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel) { if (aSelector == 0) { - if (GSUserDefaultsFlag(GSMacOSXCompatible)) + if ([_GSPrivate userDefaultsFlag: GSMacOSXCompatible]) { [NSException raise: NSInvalidArgumentException format: @"%@ null selector given", diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index e4ce18267..5f4fa6d1c 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -1082,7 +1082,7 @@ NSHomeDirectoryForUser(NSString *loginName) pw = getpwnam ([loginName cString]); if (pw != 0 && pw->pw_dir != NULL) { - s = [NSString stringWithCString: pw->pw_dir]; + s = [NSString stringWithUTF8String: pw->pw_dir]; } [gnustep_global_lock unlock]; #else @@ -1152,7 +1152,7 @@ NSFullUserName(void) struct passwd *pw; pw = getpwnam([NSUserName() cString]); - userName = [NSString stringWithCString: pw->pw_gecos]; + userName = [NSString stringWithUTF8String: pw->pw_gecos]; #else NSLog(@"Warning: NSFullUserName not implemented\n"); userName = NSUserName(); diff --git a/Source/NSPipe.m b/Source/NSPipe.m index b9c630e05..d6d4925bd 100644 --- a/Source/NSPipe.m +++ b/Source/NSPipe.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. $Date$ $Revision$ */ @@ -28,6 +29,7 @@ #include "Foundation/NSObject.h" #include "Foundation/NSFileHandle.h" #include "Foundation/NSDebug.h" +#include "GSPrivate.h" #ifdef HAVE_UNISTD_H #include #endif @@ -77,7 +79,7 @@ } else { - NSLog(@"Failed to create pipe ... %s", GSLastErrorStr(errno)); + NSLog(@"Failed to create pipe ... %@", [_GSPrivate error]); DESTROY(self); } #else @@ -95,6 +97,11 @@ writeHandle = [[NSFileHandle alloc] initWithNativeHandle: writeh closeOnDealloc: YES]; } + else + { + NSLog(@"Failed to create pipe ... %@", [_GSPrivate error]); + DESTROY(self); + } #endif } return self; diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 2d8705833..aa7bd5b9f 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -262,7 +262,7 @@ _gnu_process_args(int argc, char *argv[], char *env[]) objc_free(buffer); } } - tmp = [arg0 UTF8String]; + tmp = [arg0 cStringUsingEncoding: [NSString defaultCStringEncoding]]; _gnu_arg_zero = (char*)objc_malloc(strlen(tmp) + 1); strcpy(_gnu_arg_zero, tmp); #else @@ -317,6 +317,7 @@ _gnu_process_args(int argc, char *argv[], char *env[]) NSMutableSet *mySet; id obj_argv[argc]; int added = 1; + NSStringEncoding enc = [_GSPrivate defaultCStringEncoding]; mySet = [NSMutableSet new]; @@ -325,7 +326,7 @@ _gnu_process_args(int argc, char *argv[], char *env[]) for (i = 1; i < argc; i++) { - str = [NSString stringWithCString: argv[i]]; + str = [NSString stringWithCString: argv[i] encoding: enc]; if ([str hasPrefix: @"--GNU-Debug="]) [mySet addObject: [str substringFromIndex: 12]]; @@ -345,6 +346,7 @@ _gnu_process_args(int argc, char *argv[], char *env[]) { NSMutableArray *keys = [NSMutableArray new]; NSMutableArray *values = [NSMutableArray new]; + NSStringEncoding enc = [_GSPrivate defaultCStringEncoding]; #if defined(__MINGW32__) if (fallbackInitialisation == NO) @@ -408,8 +410,10 @@ _gnu_process_args(int argc, char *argv[], char *env[]) strcpy(buf, env[i]); cp = &buf[cp - env[i]]; *cp++ = '\0'; - [keys addObject: [NSString stringWithCString: buf]]; - [values addObject: [NSString stringWithCString: cp]]; + [keys addObject: + [NSString stringWithCString: buf encoding: enc]]; + [values addObject: + [NSString stringWithCString: cp encoding: enc]]; } i++; } @@ -1230,11 +1234,8 @@ BOOL GSDebugSet(NSString *level) return YES; } -/** - * Internal function for GNUstep base library - */ -BOOL -GSEnvironmentFlag(const char *name, BOOL def) +@implementation _GSPrivate (ProcessInfo) ++ (BOOL) environmentFlag: (const char *)name defaultValue: (BOOL)def { const char *c = getenv(name); BOOL a = def; @@ -1261,13 +1262,7 @@ GSEnvironmentFlag(const char *name, BOOL def) return a; } -/** - * Internal function for GNUstep base library. - * Used by NSException uncaught exception handler - must not call any - * methods/functions which might cause a recursive exception. - */ -const char* -GSArgZero(void) ++ (const char*) argZero { if (_gnu_arg_zero == 0) return ""; @@ -1275,4 +1270,5 @@ GSArgZero(void) return _gnu_arg_zero; } +@end diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index 0013673f5..d217186cf 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -2168,7 +2168,7 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml, { style = NSPropertyListXMLFormat_v1_0; } - else if (GSUserDefaultsFlag(NSWriteOldStylePropertyLists)) + else if ([_GSPrivate userDefaultsFlag: NSWriteOldStylePropertyLists] == YES) { style = NSPropertyListOpenStepFormat; } diff --git a/Source/NSScanner.m b/Source/NSScanner.m index a4f897221..6624f1367 100644 --- a/Source/NSScanner.m +++ b/Source/NSScanner.m @@ -140,8 +140,8 @@ typedef struct { GSPlaceholderStringClass = [GSPlaceholderString class]; NSConstantStringClass = [NSString constantStringClass]; _holder = (id)NSAllocateObject(GSPlaceholderStringClass, 0, 0); - externalEncoding = GetDefEncoding(); - if (GSIsByteEncoding(externalEncoding) == YES) + externalEncoding = [NSString defaultCStringEncoding]; + if ([_GSPrivate isByteEncoding: externalEncoding] == YES) { internalEncoding = externalEncoding; } @@ -169,7 +169,7 @@ typedef struct { if (scanner != nil) { - [scanner setLocale: GSUserDefaultsDictionaryRepresentation()]; + [scanner setLocale: [_GSPrivate userDefaultsDictionaryRepresentation]]; } return scanner; } diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m index 428679c92..09a4874b4 100644 --- a/Source/NSSocketPort.m +++ b/Source/NSSocketPort.m @@ -269,7 +269,7 @@ decodePort(NSData *data, NSString *defaultAddress) pi->addr, pnum); return nil; } - addr = [NSString stringWithCString: pi->addr]; + addr = [NSString stringWithUTF8String: pi->addr]; NSDebugFLLog(@"NSPort", @"Decoded port as '%@:%d'", addr, pnum); @@ -390,8 +390,8 @@ static Class runLoopClass; dummy = 1; if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR) { - NSLog(@"unable to set non-blocking mode on %d - %s", - d, GSLastErrorStr(errno)); + NSLog(@"unable to set non-blocking mode on %d - %@", + d, [_GSPrivate error]); return nil; } #else /* !__MINGW32__ */ @@ -400,15 +400,15 @@ static Class runLoopClass; e |= NBLK_OPT; if (fcntl(d, F_SETFL, e) < 0) { - NSLog(@"unable to set non-blocking mode on %d - %s", - d, GSLastErrorStr(errno)); + NSLog(@"unable to set non-blocking mode on %d - %@", + d, [_GSPrivate error]); return nil; } } else { - NSLog(@"unable to get non-blocking mode on %d - %s", - d, GSLastErrorStr(errno)); + NSLog(@"unable to get non-blocking mode on %d - %@", + d, [_GSPrivate error]); return nil; } #endif @@ -545,9 +545,9 @@ static Class runLoopClass; if (errno != EINPROGRESS) #endif { - NSLog(@"unable to make connection to %s:%d - %s", + NSLog(@"unable to make connection to %s:%d - %@", inet_ntoa(sockAddr.sin_addr), - GSSwapBigI16ToHost(sockAddr.sin_port), GSLastErrorStr(errno)); + GSSwapBigI16ToHost(sockAddr.sin_port), [_GSPrivate error]); if (addrNum < [addrs count]) { BOOL result; @@ -817,7 +817,7 @@ static Class runLoopClass; #endif /* !__MINGW32__ */ { NSDebugMLLog(@"GSTcpHandle", - @"read failed - %s on 0x%x", GSLastErrorStr(errno), self); + @"read failed - %@ on 0x%p", [_GSPrivate error], self); [self invalidate]; return; } @@ -1108,7 +1108,7 @@ static Class runLoopClass; && res != 0) { state = GS_H_UNCON; - NSLog(@"connect attempt failed - %s", GSLastErrorStr(res)); + NSLog(@"connect attempt failed - %@", [_GSPrivate error]); } else { @@ -1118,7 +1118,7 @@ static Class runLoopClass; if (len == (int)[d length]) { RELEASE(defaultAddress); - defaultAddress = RETAIN([NSString stringWithCString: + defaultAddress = RETAIN([NSString stringWithUTF8String: inet_ntoa(sockAddr.sin_addr)]); NSDebugMLLog(@"GSTcpHandle", @"wrote %d bytes on 0x%x", len, self); @@ -1127,8 +1127,8 @@ static Class runLoopClass; else { state = GS_H_UNCON; - NSLog(@"connect write attempt failed - %s", - GSLastErrorStr(errno)); + NSLog(@"connect write attempt failed - %@", + [_GSPrivate error]); } RELEASE(d); } @@ -1166,7 +1166,7 @@ static Class runLoopClass; if (errno != EINTR && errno != EAGAIN) #endif /* !__MINGW32__ */ { - NSLog(@"write attempt failed - %s", GSLastErrorStr(errno)); + NSLog(@"write attempt failed - %@", [_GSPrivate error]); [self invalidate]; return; } @@ -1635,7 +1635,7 @@ static Class tcpPortClass; else if ((desc = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); DESTROY(port); } #ifndef BROKEN_SO_REUSEADDR @@ -1649,29 +1649,29 @@ static Class tcpPortClass; sizeof(reuse)) < 0) { (void) close(desc); - NSLog(@"unable to set reuse on socket - %s", - GSLastErrorStr(errno)); + NSLog(@"unable to set reuse on socket - %@", + [_GSPrivate error]); DESTROY(port); } #endif else if (bind(desc, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR) { - NSLog(@"unable to bind to port %s:%d - %s", - inet_ntoa(sockaddr.sin_addr), number, GSLastErrorStr(errno)); + NSLog(@"unable to bind to port %s:%d - %@", + inet_ntoa(sockaddr.sin_addr), number, [_GSPrivate error]); (void) close(desc); DESTROY(port); } else if (listen(desc, 128) == SOCKET_ERROR) { - NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno)); + NSLog(@"unable to listen on port - %@", [_GSPrivate error]); (void) close(desc); DESTROY(port); } else if (getsockname(desc, (struct sockaddr*)&sockaddr, &i) == SOCKET_ERROR) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); (void) close(desc); DESTROY(port); } @@ -1971,7 +1971,7 @@ static Class tcpPortClass; handle = nil; if ((sock = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); } #ifndef BROKEN_SO_REUSEADDR /* @@ -1984,13 +1984,13 @@ static Class tcpPortClass; sizeof(opt)) < 0) { (void)close(sock); - NSLog(@"unable to set reuse on socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to set reuse on socket - %@", [_GSPrivate error]); } #endif else if ((handle = [GSTcpHandle handleWithDescriptor: sock]) == nil) { (void)close(sock); - NSLog(@"unable to create GSTcpHandle - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create GSTcpHandle - %@", [_GSPrivate error]); } else { @@ -2179,7 +2179,7 @@ static Class tcpPortClass; */ handle = [GSTcpHandle handleWithDescriptor: desc]; memcpy(&handle->sockAddr, &sockAddr, sizeof(sockAddr)); - handle->defaultAddress = RETAIN([NSString stringWithCString: + handle->defaultAddress = RETAIN([NSString stringWithUTF8String: inet_ntoa(sockAddr.sin_addr)]); [handle setState: GS_H_ACCEPT]; diff --git a/Source/NSSocketPortNameServer.m b/Source/NSSocketPortNameServer.m index db9b8d78e..cb5716209 100644 --- a/Source/NSSocketPortNameServer.m +++ b/Source/NSSocketPortNameServer.m @@ -554,7 +554,7 @@ typedef enum { serverLock = [NSRecursiveLock new]; modes = [[NSArray alloc] initWithObjects: &mode count: 1]; #ifdef GDOMAP_PORT_OVERRIDE - serverPort = RETAIN([NSString stringWithCString: + serverPort = RETAIN([NSString stringWithUTF8String: make_gdomap_port(GDOMAP_PORT_OVERRIDE)]); #endif portClass = [NSSocketPort class]; @@ -738,7 +738,7 @@ typedef enum { [array addObject: com]; RELEASE(com); [com setAddr: svrs[count]]; - addr = [NSString stringWithCString: + addr = [NSString stringWithUTF8String: (char*)inet_ntoa(svrs[count])]; [com startPortLookup: name onHost: addr]; count++; @@ -802,7 +802,7 @@ typedef enum { if (*port) { - *addr = [NSString stringWithCString: inet_ntoa(singleServer)]; + *addr = [NSString stringWithUTF8String: inet_ntoa(singleServer)]; return YES; } else diff --git a/Source/NSString.m b/Source/NSString.m index bec1fde06..2b15d90a9 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -566,8 +566,8 @@ handle_printf_atsign (FILE *stream, gcrSel = @selector(getCharacters:range:); ranSel = @selector(rangeOfComposedCharacterSequenceAtIndex:); - _DefaultStringEncoding = GetDefEncoding(); - _ByteEncodingOk = GSIsByteEncoding(_DefaultStringEncoding); + _DefaultStringEncoding = [_GSPrivate defaultCStringEncoding]; + _ByteEncodingOk = [_GSPrivate isByteEncoding: _DefaultStringEncoding]; NSStringClass = self; [self setVersion: 1]; @@ -1057,7 +1057,6 @@ handle_printf_atsign (FILE *stream, locale: (NSDictionary*)locale arguments: (va_list)argList { - extern void GSStrExternalize(); unsigned char buf[2048]; GSStr_t f; unichar fbuf[1024]; @@ -2685,7 +2684,7 @@ handle_printf_atsign (FILE *stream, */ + (NSStringEncoding*) availableStringEncodings { - return GetAvailableEncodings(); + return [_GSPrivate availableEncodings]; } /** @@ -2703,7 +2702,7 @@ handle_printf_atsign (FILE *stream, */ ourbundle = [NSBundle bundleForLibrary: @"gnustep-base"]; - ourname = GetEncodingName(encoding); + ourname = [_GSPrivate encodingName: encoding]; return [ourbundle localizedStringForKey: ourname value: ourname table: nil]; @@ -4151,7 +4150,7 @@ static NSFileManager *fm = nil; } else { - dict = GSUserDefaultsDictionaryRepresentation(); + dict = [_GSPrivate userDefaultsDictionaryRepresentation]; ret = AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()] initWithFormat: format locale: dict arguments: ap]); } @@ -4203,7 +4202,7 @@ static NSFileManager *fm = nil; */ - (NSComparisonResult) localizedCompare: (NSString *)string { - NSDictionary *dict = GSUserDefaultsDictionaryRepresentation(); + NSDictionary *dict = [_GSPrivate userDefaultsDictionaryRepresentation]; return [self compare: string options: 0 @@ -4217,7 +4216,7 @@ static NSFileManager *fm = nil; */ - (NSComparisonResult) localizedCaseInsensitiveCompare: (NSString *)string { - NSDictionary *dict = GSUserDefaultsDictionaryRepresentation(); + NSDictionary *dict = [_GSPrivate userDefaultsDictionaryRepresentation]; return [self compare: string options: NSCaseInsensitiveSearch diff --git a/Source/NSTask.m b/Source/NSTask.m index 53717b9bb..6d34dbfb4 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -47,6 +47,7 @@ #include "Foundation/NSTimer.h" #include "Foundation/NSLock.h" #include "Foundation/NSDebug.h" +#include "GSPrivate.h" #include #ifdef HAVE_UNISTD_H @@ -1561,8 +1562,8 @@ GSCheckTasks() result = waitpid(_taskId, &_terminationStatus, WNOHANG); if (result < 0) { - NSLog(@"waitpid %d, result %d, error %s", - _taskId, result, GSLastErrorStr(errno)); + NSLog(@"waitpid %d, result %d, error %@", + _taskId, result, [_GSPrivate error]); [self _terminatedChild: -1]; } else if (result == _taskId || (result > 0 && errno == 0)) @@ -1594,8 +1595,8 @@ GSCheckTasks() #ifdef WAITDEBUG else { - NSLog(@"waitpid %d, result %d, error %s", - _taskId, result, GSLastErrorStr(errno)); + NSLog(@"waitpid %d, result %d, error %@", + _taskId, result, [_GSPrivate error]); } #endif } diff --git a/Source/NSThread.m b/Source/NSThread.m index 429f1f5dc..975ac756e 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -54,6 +54,7 @@ #include "Foundation/NSConnection.h" #include "Foundation/NSInvocation.h" +#include "GSPrivate.h" #include "GSRunLoopCtxt.h" @interface NSAutoreleasePool (NSThread) @@ -889,12 +890,12 @@ static NSDate *theFuture; #if defined(__MINGW32__) if (SetEvent(event) == 0) { - NSLog(@"Set event failed - %@", GSLastErrorStr(errno)); + NSLog(@"Set event failed - %@", [_GSPrivate error]); } #else if (write(outputFd, "0", 1) != 1) { - NSLog(@"Write to pipe failed - %@", GSLastErrorStr(errno)); + NSLog(@"Write to pipe failed - %@", [_GSPrivate error]); } #endif @@ -918,12 +919,12 @@ static NSDate *theFuture; #if defined(__MINGW32__) if (ResetEvent(event) == 0) { - NSLog(@"Reset event failed - %@", GSLastErrorStr(errno)); + NSLog(@"Reset event failed - %@", [_GSPrivate error]); } #else if (read(inputFd, &c, 1) != 1) { - NSLog(@"Read pipe failed - %@", GSLastErrorStr(errno)); + NSLog(@"Read pipe failed - %@", [_GSPrivate error]); } #endif diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m index 45828e873..f09cda526 100644 --- a/Source/NSTimeZone.m +++ b/Source/NSTimeZone.m @@ -1487,7 +1487,7 @@ static NSMapTable *absolutes = 0; bufsize--; } localZoneString - = [NSString stringWithCString: buf length: bufsize]; + = [NSString stringWithUTF8String: buf length: bufsize]; } RegCloseKey(regkey); } diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index d4cb90fb5..9a1c17bf7 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -1955,8 +1955,9 @@ static BOOL isLocked = NO; } @end -NSDictionary* -GSUserDefaultsDictionaryRepresentation() +@implementation _GSPrivate (UserDefaults) + ++ (NSDictionary*) userDefaultsDictionaryRepresentation { NSDictionary *defs; @@ -1970,11 +1971,7 @@ GSUserDefaultsDictionaryRepresentation() return defs; } -/* - * Get one of several potentially useful flags. - */ -BOOL -GSUserDefaultsFlag(GSUserDefaultFlagType type) ++ (BOOL) userDefaultsFlag: (GSUserDefaultFlagType)type { if (sharedDefaults == nil) { @@ -1982,4 +1979,5 @@ GSUserDefaultsFlag(GSUserDefaultFlagType type) } return flags[type]; } +@end diff --git a/Source/objc-load.m b/Source/objc-load.m index cae18be69..1657d1970 100644 --- a/Source/objc-load.m +++ b/Source/objc-load.m @@ -385,7 +385,7 @@ objc_get_symbol_path(Class theClass, Category *theCategory) if (ret) { - return [NSString stringWithCString: ret]; + return [NSString stringWithUTF8String: ret]; } return nil; diff --git a/Source/unix/GSRunLoopCtxt.m b/Source/unix/GSRunLoopCtxt.m index aebf55267..ae48e02dd 100644 --- a/Source/unix/GSRunLoopCtxt.m +++ b/Source/unix/GSRunLoopCtxt.m @@ -419,8 +419,8 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt) /* Some exceptional condition happened. */ /* xxx We can do something with exception_fds, instead of aborting here. */ - NSLog (@"poll() error in -acceptInputForMode:beforeDate: '%s'", - GSLastErrorStr(errno)); + NSLog (@"poll() error in -acceptInputForMode:beforeDate: '%@'", + [_GSPrivate error]); abort (); } } @@ -800,8 +800,8 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt) /* Some exceptional condition happened. */ /* xxx We can do something with exception_fds, instead of aborting here. */ - NSLog (@"select() error in -acceptInputForMode:beforeDate: '%s'", - GSLastErrorStr(errno)); + NSLog (@"select() error in -acceptInputForMode:beforeDate: '%@'", + [_GSPrivate error]); abort (); } } diff --git a/Source/win32/GSFileHandleWin32.m b/Source/win32/GSFileHandleWin32.m index 8d153db76..dfd37eb22 100644 --- a/Source/win32/GSFileHandleWin32.m +++ b/Source/win32/GSFileHandleWin32.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. */ #define _FILE_OFFSET_BITS 64 @@ -792,7 +793,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); RELEASE(self); return nil; } @@ -806,8 +807,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { if (bind(net, (struct sockaddr *)&lsin, sizeof(lsin)) == SOCKET_ERROR) { - NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(lsin.sin_addr), - GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); + NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(lsin.sin_addr), + GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]); (void) closesocket(net); RELEASE(self); return nil; @@ -825,9 +826,9 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { if (WSAGetLastError() != WSAEWOULDBLOCK) { - NSLog(@"unable to make connection to %s:%d - %s", + NSLog(@"unable to make connection to %s:%d - %@", inet_ntoa(sin.sin_addr), - GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); + GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]); RELEASE(self); return nil; } @@ -891,7 +892,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET) { - NSLog(@"unable to create socket - %s", GSLastErrorStr(errno)); + NSLog(@"unable to create socket - %@", [_GSPrivate error]); RELEASE(self); return nil; } @@ -908,8 +909,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) == SOCKET_ERROR) { - NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr), - GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); + NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr), + GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]); (void) closesocket(net); RELEASE(self); return nil; @@ -917,7 +918,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (listen(net, 256) == SOCKET_ERROR) { - NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno)); + NSLog(@"unable to listen on port - %@", [_GSPrivate error]); (void) closesocket(net); RELEASE(self); return nil; @@ -925,7 +926,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (getsockname(net, (struct sockaddr*)&sin, &size) == SOCKET_ERROR) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); (void) closesocket(net); RELEASE(self); return nil; @@ -1092,8 +1093,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (_fstat(desc, &sbuf) != 0) { - NSLog(@"unable to get status of descriptor %d - %s", - desc, GSLastErrorStr(errno)); + NSLog(@"unable to get status of descriptor %d - %@", + desc, [_GSPrivate error]); } else { @@ -1293,8 +1294,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (len < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } return d; } @@ -1318,8 +1319,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (len < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } return d; } @@ -1344,8 +1345,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (got < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } [d setLength: got]; } @@ -1367,8 +1368,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; else if (got < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to read from descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to read from descriptor - %@", + [_GSPrivate error]]; } } while (len > 0 && got > 0); @@ -1414,8 +1415,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (rval < 0) { [NSException raise: NSFileHandleOperationException - format: @"unable to write to descriptor - %s", - GSLastErrorStr(errno)]; + format: @"unable to write to descriptor - %@", + [_GSPrivate error]]; } } @@ -1520,8 +1521,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (result < 0) { [NSException raise: NSFileHandleOperationException - format: @"failed to move to offset in file - %s", - GSLastErrorStr(errno)]; + format: @"failed to move to offset in file - %@", + [_GSPrivate error]]; } return (unsigned long long)result; } @@ -1544,8 +1545,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (result < 0) { [NSException raise: NSFileHandleOperationException - format: @"failed to move to offset in file - %s", - GSLastErrorStr(errno)]; + format: @"failed to move to offset in file - %@", + [_GSPrivate error]]; } return (unsigned long long)result; } @@ -1568,8 +1569,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (result < 0) { [NSException raise: NSFileHandleOperationException - format: @"failed to move to offset in file - %s", - GSLastErrorStr(errno)]; + format: @"failed to move to offset in file - %@", + [_GSPrivate error]]; } } @@ -1927,8 +1928,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Accept attempt failed - %s", - GSLastErrorStr(errno)]; + s = [NSString stringWithFormat: @"Accept attempt failed - %@", + [_GSPrivate error]]; [readInfo setObject: s forKey: GSFileHandleNotificationError]; } else @@ -1996,8 +1997,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Read attempt failed - %s", - GSLastErrorStr(errno)]; + s = [NSString stringWithFormat: @"Read attempt failed - %@", + [_GSPrivate error]]; [readInfo setObject: s forKey: GSFileHandleNotificationError]; [self postReadNotification]; } @@ -2005,8 +2006,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Read attempt failed - %s", - GSLastErrorStr(errno)]; + s = [NSString stringWithFormat: @"Read attempt failed - %@", + [_GSPrivate error]]; [readInfo setObject: s forKey: GSFileHandleNotificationError]; [self postReadNotification]; } @@ -2045,8 +2046,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; { NSString *s; - s = [NSString stringWithFormat: @"Connect attempt failed - %s", - GSLastErrorStr(result)]; + s = [NSString stringWithFormat: @"Connect attempt failed - %@", + [_GSPrivate error]]; [info setObject: s forKey: GSFileHandleNotificationError]; } else @@ -2080,7 +2081,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; NSString *s; s = [NSString stringWithFormat: - @"Write attempt failed - %s", GSLastErrorStr(errno)]; + @"Write attempt failed - %@", [_GSPrivate error]]; [info setObject: s forKey: GSFileHandleNotificationError]; [self postWriteNotification]; } @@ -2193,7 +2194,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; - (void) setAddr: (struct sockaddr_in *)sin { - address = [[NSString alloc] initWithCString: (char*)inet_ntoa(sin->sin_addr)]; + address = [[NSString alloc] initWithUTF8String: + (char*)inet_ntoa(sin->sin_addr)]; service = [[NSString alloc] initWithFormat: @"%d", (int)GSSwapBigI16ToHost(sin->sin_port)]; protocol = @"tcp"; @@ -2239,8 +2241,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (ioctlsocket((SOCKET)_get_osfhandle(descriptor), FIONBIO, &dummy) == SOCKET_ERROR) { - NSLog(@"unable to set non-blocking mode - %s", - GSLastErrorStr(errno)); + NSLog(@"unable to set non-blocking mode - %@", + [_GSPrivate error]); } else isNonBlocking = flag; @@ -2251,8 +2253,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (ioctlsocket((SOCKET)_get_osfhandle(descriptor), FIONBIO, &dummy) == SOCKET_ERROR) { - NSLog(@"unable to set blocking mode - %s", - GSLastErrorStr(errno)); + NSLog(@"unable to set blocking mode - %@", [_GSPrivate error]); } else isNonBlocking = flag; @@ -2273,11 +2274,11 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); } else { - str = [NSString stringWithCString: (char*)inet_ntoa(sin.sin_addr)]; + str = [NSString stringWithUTF8String: (char*)inet_ntoa(sin.sin_addr)]; } return str; } @@ -2290,7 +2291,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR) { - NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); + NSLog(@"unable to get socket name - %@", [_GSPrivate error]); } else { diff --git a/Source/win32/GSRunLoopCtxt.m b/Source/win32/GSRunLoopCtxt.m index 9eebff4bb..a07db86b3 100644 --- a/Source/win32/GSRunLoopCtxt.m +++ b/Source/win32/GSRunLoopCtxt.m @@ -436,8 +436,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = BOOL found = NO; NSDebugMLLog(@"NSRunLoop", @"WaitForMultipleObjects() error in " - @"-acceptInputForMode:beforeDate: %s", - GSLastErrorStr(GetLastError())); + @"-acceptInputForMode:beforeDate: %@", [_GSPrivate error]); /* * Check each handle in turn until either we find one which has an * event signalled, or we find the one which caused the original @@ -458,8 +457,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = if (found == NO) { NSLog(@"WaitForMultipleObjects() error in " - @"-acceptInputForMode:beforeDate: %s", - GSLastErrorStr(GetLastError())); + @"-acceptInputForMode:beforeDate: %@", [_GSPrivate error]); abort (); } } diff --git a/Source/win32/NSMessagePortNameServerWin32.m b/Source/win32/NSMessagePortNameServerWin32.m index a1682d6a5..cd30dd940 100644 --- a/Source/win32/NSMessagePortNameServerWin32.m +++ b/Source/win32/NSMessagePortNameServerWin32.m @@ -311,8 +311,8 @@ OutputDebugStringW(L""); } else { - NSLog(@"Failed to insert HKEY_CURRENT_USER\\%@\\%@ (%x) %s", - registry, n, rc, GSLastErrorStr(rc)); + NSLog(@"Failed to insert HKEY_CURRENT_USER\\%@\\%@ (%x) %@", + registry, n, rc, [_GSPrivate error: rc]); return NO; } diff --git a/Source/win32/NSMessagePortWin32.m b/Source/win32/NSMessagePortWin32.m index 19ea79d40..6094bbe10 100644 --- a/Source/win32/NSMessagePortWin32.m +++ b/Source/win32/NSMessagePortWin32.m @@ -206,8 +206,8 @@ static Class messagePortClass = 0; M_UNLOCK(messagePortLock); if ([p _setupSendPort] == NO) { - NSLog(@"unable to access mailslot '%@' - %s", - [p name], GSLastErrorStr(errno)); + NSLog(@"unable to access mailslot '%@' - %@", + [p name], [_GSPrivate error]); DESTROY(p); } return p; @@ -334,8 +334,8 @@ static Class messagePortClass = 0; if (this->rHandle == INVALID_HANDLE_VALUE) { - NSLog(@"unable to create mailslot '%@' - %s", - this->name, GSLastErrorStr(errno)); + NSLog(@"unable to create mailslot '%@' - %@", + this->name, [_GSPrivate error]); DESTROY(self); } else @@ -507,14 +507,14 @@ static Class messagePortClass = 0; } else { - NSLog(@"GetOverlappedResult failed ...%s", GSLastErrorStr(errno)); + NSLog(@"GetOverlappedResult failed ... %@", [_GSPrivate error]); this->rState = RS_NONE; this->rLength = 0; } } else { - NSLog(@"GetOverlappedResult success ...%u", this->rSize); + NSLog(@"GetOverlappedResult success ... %u", this->rSize); this->rState = RS_NONE; this->rLength = 0; } @@ -529,8 +529,8 @@ static Class messagePortClass = 0; 0, 0) == 0) { - NSLog(@"unable to get info from mailslot '%@' - %s", - this->name, GSLastErrorStr(errno)); + NSLog(@"unable to get info from mailslot '%@' - %@", + this->name, [_GSPrivate error]); [self invalidate]; return; } @@ -546,16 +546,15 @@ static Class messagePortClass = 0; &this->rSize, NULL) == 0) { - NSLog(@"unable to read from mailslot '%@' - %s", - this->name, GSLastErrorStr(errno)); + NSLog(@"unable to read from mailslot '%@' - %@", + this->name, [_GSPrivate error]); [self invalidate]; return; } if (this->rSize != this->rWant) { - NSLog(@"only read %d of %d bytes from mailslot '%@' - %s", - this->rSize, this->rWant, this->name, - GSLastErrorStr(errno)); + NSLog(@"only read %d of %d bytes from mailslot '%@' - %@", + this->rSize, this->rWant, this->name, [_GSPrivate error]); [self invalidate]; return; } @@ -749,8 +748,8 @@ static Class messagePortClass = 0; } else { - NSLog(@"unable to read from mailslot '%@' - %s", - this->name, GSLastErrorStr(errno)); + NSLog(@"unable to read from mailslot '%@' - %@", + this->name, [_GSPrivate error]); [self invalidate]; } } @@ -804,7 +803,7 @@ static Class messagePortClass = 0; &this->wSize, TRUE) == 0) { - NSLog(@"GetOverlappedResult failed ...%s", GSLastErrorStr(errno)); + NSLog(@"GetOverlappedResult failed ... %@", [_GSPrivate error]); } else { @@ -856,8 +855,8 @@ again: } else if ((errno = GetLastError()) != ERROR_IO_PENDING) { - NSLog(@"unable to write to mailslot '%@' - %s", - this->name, GSLastErrorStr(errno)); + NSLog(@"unable to write to mailslot '%@' - %@", + this->name, [_GSPrivate error]); [self invalidate]; } else diff --git a/Source/win32/NSStreamWin32.m b/Source/win32/NSStreamWin32.m index 10e4a8b37..bef569299 100644 --- a/Source/win32/NSStreamWin32.m +++ b/Source/win32/NSStreamWin32.m @@ -269,7 +269,7 @@ static void setNonblocking(SOCKET fd) unsigned long dummy = 1; if (ioctlsocket(fd, FIONBIO, &dummy) == SOCKET_ERROR) - NSLog(@"unable to set non-blocking mode - %s",GSLastErrorStr(errno)); + NSLog(@"unable to set non-blocking mode - %@", [_GSPrivate error]); } @implementation GSFileInputStream @@ -1866,8 +1866,8 @@ static void setNonblocking(SOCKET fd) if (handle == INVALID_HANDLE_VALUE) { [NSException raise: NSInternalInconsistencyException - format: @"Unable to open named pipe '%@'... %s", - path, GSLastErrorStr(GetLastError())]; + format: @"Unable to open named pipe '%@'... %@", + path, [_GSPrivate error]]; } // the type of the stream does not matter, since we are only using the fd diff --git a/Source/win32/NSUserDefaultsWin32.m b/Source/win32/NSUserDefaultsWin32.m index 2c9d2d3d5..24688bf30 100644 --- a/Source/win32/NSUserDefaultsWin32.m +++ b/Source/win32/NSUserDefaultsWin32.m @@ -228,30 +228,35 @@ struct NSUserDefaultsWin32_DomainInfo id v; NSString *k; - switch (type) { - case REG_SZ: { - int datacharlen = datalen / 2; - if (datacharlen > 0 && data[datacharlen-1] == 0) - datacharlen--; + switch (type) + { + case REG_SZ: + { + int datacharlen = datalen / 2; + if (datacharlen > 0 && data[datacharlen-1] == 0) + datacharlen--; - v = [NSString stringWithCharacters:data length:datacharlen]; - } - break; - case REG_BINARY: { - v = [NSString stringWithCString: (char*)data - encoding: NSASCIIStringEncoding]; - } - break; - default: - NSLog(@"Bad registry type %d for '%S'", type, name); - v = 0; - } + v = [NSString stringWithCharacters: data + length: datacharlen]; + } + break; + case REG_BINARY: + { + v = [NSString stringWithCString: (char*)data + encoding: NSASCIIStringEncoding]; + } + break; + default: + NSLog(@"Bad registry type %d for '%S'", type, name); + v = 0; + } v = [v propertyList]; if (v) - { - k = [NSString stringWithCharacters: name length: namelen]; - [domainDict setObject: v forKey: k]; - } + { + k = [NSString stringWithCharacters: name + length: namelen]; + [domainDict setObject: v forKey: k]; + } } NS_HANDLER NSLog(@"Bad registry value for '%S'", name); @@ -319,30 +324,35 @@ struct NSUserDefaultsWin32_DomainInfo id v; NSString *k; - switch (type) { - case REG_SZ: { - int datacharlen = datalen / 2; - if (datacharlen > 0 && data[datacharlen-1] == 0) - datacharlen--; + switch (type) + { + case REG_SZ: + { + int datacharlen = datalen / 2; + if (datacharlen > 0 && data[datacharlen-1] == 0) + datacharlen--; - v = [NSString stringWithCharacters:data length:datacharlen]; - } - break; - case REG_BINARY: { - v = [NSString stringWithCString: (char*)data - encoding: NSASCIIStringEncoding]; - } - break; - default: - NSLog(@"Bad registry type %d for '%S'", type, name); - v = 0; - } + v = [NSString stringWithCharacters: data + length: datacharlen]; + } + break; + case REG_BINARY: + { + v = [NSString stringWithCString: (char*)data + encoding: NSASCIIStringEncoding]; + } + break; + default: + NSLog(@"Bad registry type %d for '%S'", type, name); + v = 0; + } v = [v propertyList]; if (v) - { - k = [NSString stringWithCharacters: name length: namelen]; - [domainDict setObject: v forKey: k]; - } + { + k = [NSString stringWithCharacters: name + length: namelen]; + [domainDict setObject: v forKey: k]; + } } NS_HANDLER NSLog(@"Bad registry value for '%S'", name); diff --git a/Testing/benchmark.m b/Testing/benchmark.m index 3957a4c96..052ee69ed 100755 --- a/Testing/benchmark.m +++ b/Testing/benchmark.m @@ -263,7 +263,7 @@ bench_array() { char buf1[100]; sprintf(buf1, "str%0d", i); - strings[i] = [stringClass stringWithCString: buf1]; + strings[i] = [stringClass stringWithUTF8String: buf1]; } printf("NSArray\n"); array = [NSMutableArray arrayWithCapacity: 16]; @@ -316,8 +316,8 @@ bench_dict() char buf1[100], buf2[100]; sprintf(buf1, "key%0d", i); sprintf(buf2, "val%0d", i); - keys[i] = [stringClass stringWithCString: buf1]; - vals[i] = [stringClass stringWithCString: buf2]; + keys[i] = [stringClass stringWithUTF8String: buf1]; + vals[i] = [stringClass stringWithUTF8String: buf2]; } printf("NSDictionary\n"); dict = [NSMutableDictionary dictionaryWithCapacity: 16]; @@ -487,7 +487,7 @@ bench_str() START_TIMER; for (i = 0; i < MAX_COUNT; i++) { - str = [stringClass stringWithCString: "hello world"]; + str = [stringClass stringWithUTF8String: "hello world"]; } END_TIMER; PRINT_TIMER("NSString (1 cstring:) \t\t"); diff --git a/Testing/call.m b/Testing/call.m index 7a587a16d..01df80206 100644 --- a/Testing/call.m +++ b/Testing/call.m @@ -72,11 +72,11 @@ GS_EXPORT NSString * const GSTelnetTextKey; if (i > 0 && ptr[i-1] == '\r') { - s = [NSString stringWithCString: ptr length: i-1]; + s = [NSString stringWithUTF8String: ptr length: i-1]; } else { - s = [NSString stringWithCString: ptr length: i]; + s = [NSString stringWithUTF8String: ptr length: i]; } len -= (i + 1); if (len > 0) diff --git a/Testing/exported-strings.m b/Testing/exported-strings.m index fd742191c..8ea4ed032 100644 --- a/Testing/exported-strings.m +++ b/Testing/exported-strings.m @@ -31,7 +31,7 @@ #define MyAssert2(IDENT) do { \ NSCAssert2([IDENT isEqual: \ - [NSString stringWithCString: #IDENT]], \ + [NSString stringWithUTF8String: #IDENT]], \ @"Invalid value: %@ for: %s", \ IDENT, #IDENT); \ NSCAssert2([cache[i++] isEqual: IDENT], \ diff --git a/Testing/nsconnection_server.m b/Testing/nsconnection_server.m index ac3af5461..e4e04f778 100644 --- a/Testing/nsconnection_server.m +++ b/Testing/nsconnection_server.m @@ -522,7 +522,7 @@ int main(int argc, char *argv[], char **env) [c setRootObject: l]; if (optind < argc) - [c registerName: [NSString stringWithCString: argv[optind]]]; + [c registerName: [NSString stringWithUTF8String: argv[optind]]]; else [c registerName: @"test2server"]; diff --git a/Testing/tcpport-client.m b/Testing/tcpport-client.m index fbab00093..6188eb420 100644 --- a/Testing/tcpport-client.m +++ b/Testing/tcpport-client.m @@ -33,7 +33,7 @@ int main (int argc, char *argv[]) if (argc > 1) out_port = [TcpOutPort newForSendingToRegisteredName: - [NSString stringWithCString: argv[1]] + [NSString stringWithUTF8String: argv[1]] onHost: @"localhost"]; else out_port = [TcpOutPort newForSendingToRegisteredName: @"tcpport-test" diff --git a/Testing/tcpport-server.m b/Testing/tcpport-server.m index 988d9b1b7..33c70c3f3 100644 --- a/Testing/tcpport-server.m +++ b/Testing/tcpport-server.m @@ -72,7 +72,7 @@ int main (int argc, char *argv[]) { if (argc > 1) port = [TcpInPort newForReceivingFromRegisteredName: - [NSString stringWithCString: argv[1]]]; + [NSString stringWithUTF8String: argv[1]]]; else port = [TcpInPort newForReceivingFromRegisteredName: @"tcpport-test"]; diff --git a/Tools/AGSParser.m b/Tools/AGSParser.m index 80cb071df..9c3357b45 100644 --- a/Tools/AGSParser.m +++ b/Tools/AGSParser.m @@ -2333,11 +2333,11 @@ fail: method = [[NSMutableDictionary alloc] initWithCapacity: 4]; if (buffer[pos++] == '-') { - mname = [NSMutableString stringWithCString: "-"]; + mname = [NSMutableString stringWithUTF8String: "-"]; } else { - mname = [NSMutableString stringWithCString: "+"]; + mname = [NSMutableString stringWithUTF8String: "+"]; } [method setObject: sels forKey: @"Sels"]; // Parts of selector. diff --git a/Tools/Makefile.preamble b/Tools/Makefile.preamble index 487d0bfb2..e9c569791 100644 --- a/Tools/Makefile.preamble +++ b/Tools/Makefile.preamble @@ -19,7 +19,8 @@ # # You should have received a copy of the GNU General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02111 USA. # # diff --git a/Tools/defaults.m b/Tools/defaults.m index 9e837fb61..932b93d96 100644 --- a/Tools/defaults.m +++ b/Tools/defaults.m @@ -62,7 +62,7 @@ static NSString *input(char **ptr) { tmp[-1] = '\0'; *ptr = tmp; - result = [NSString stringWithCString: start]; + result = [NSString stringWithUTF8String: start]; break; } } @@ -76,7 +76,7 @@ static NSString *input(char **ptr) } *tmp++ = '\0'; *ptr = tmp; - result = [NSString stringWithCString: start]; + result = [NSString stringWithUTF8String: start]; } return result; } diff --git a/Tools/locale_alias.m b/Tools/locale_alias.m index bd594c30f..9056a235b 100644 --- a/Tools/locale_alias.m +++ b/Tools/locale_alias.m @@ -64,12 +64,12 @@ loc_read_file(const char *dir, const char *file) if (strlen(country) > 0 && strcmp(country, language) != 0) { strcat(country, language); - [dict setObject: [NSString stringWithCString: country] - forKey: [NSString stringWithCString: locale]]; + [dict setObject: [NSString stringWithUTF8String: country] + forKey: [NSString stringWithUTF8String: locale]]; } locale[2] = '\0'; - [dict setObject: [NSString stringWithCString: language] - forKey: [NSString stringWithCString: locale]]; + [dict setObject: [NSString stringWithUTF8String: language] + forKey: [NSString stringWithUTF8String: locale]]; fclose(fp); return 0; } diff --git a/Tools/make_strings/make_strings.m b/Tools/make_strings/make_strings.m index 27f3b40e3..831d4ec4a 100644 --- a/Tools/make_strings/make_strings.m +++ b/Tools/make_strings/make_strings.m @@ -135,13 +135,14 @@ static int ParseFile(const char *filename,NSMutableDictionary *tables) } - filenamestr=[NSString stringWithCString: filename]; + filenamestr = [NSString stringWithCString: filename + encoding: [NSString defaultCStringEncoding]]; if (verbose) - printf("Parsing '%s'.\n", [filenamestr cString]); + printf("Parsing '%s'.\n", filename); f=fopen(filename,"rt"); if (!f) { - NSLog(@"Unable to open '%s': %m\n",filename); + NSLog(@"Unable to open '%@': %m\n",filenamestr); return 1; } diff --git a/Tools/pl.m b/Tools/pl.m index 66a81aea7..356a892b6 100644 --- a/Tools/pl.m +++ b/Tools/pl.m @@ -69,7 +69,7 @@ id process_plist(NSData *inputData) NSString *string = nil; // Initialize a string with the contents of the file. - string = [NSString stringWithCString: (char *)[inputData bytes]]; + string = [NSString stringWithUTF8String: (char *)[inputData bytes]]; // Convert the string into a property list. If there is a parsing error // the property list interpreter will throw an exception. diff --git a/Tools/xmlparse.m b/Tools/xmlparse.m index ce658de08..d7ea2d992 100644 --- a/Tools/xmlparse.m +++ b/Tools/xmlparse.m @@ -55,7 +55,7 @@ { buf[--len] = '\0'; } - str = [NSString stringWithCString: buf]; + str = [NSString stringWithUTF8String: buf]; return str; } @end From 3ea83c27ddf6021b73592f9ce38af9ae60a53f36 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 9 Oct 2006 14:34:42 +0000 Subject: [PATCH 037/266] Improve report of deprecation/removal git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23796 72102866-910b-0410-8b05-ffd578937521 --- Tools/AGSHtml.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 08fbe5cc1..5b2eb239c 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -2502,7 +2502,7 @@ static NSString *mainFont = nil; } if ([gvrem length] > 0) { - [buf appendString: @" removed at "]; + [buf appendString: @" deprecated for removal at "]; [buf appendString: gvrem]; } } @@ -2525,7 +2525,7 @@ static NSString *mainFont = nil; [buf appendString: @"
\n"]; if ([gvrem length] > 0) { - [buf appendString: @" removed at "]; + [buf appendString: @" deprecated for removal at "]; [buf appendString: gvrem]; } [buf appendString:@"\n"]; From 48522ab8cd716a77a4770f187a5c21141193cbf7 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 9 Oct 2006 15:13:44 +0000 Subject: [PATCH 038/266] Update/improve version/deprecation reporting. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23797 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 17 ++++ Documentation/Base.gsdoc | 2 +- Documentation/BaseAdditions.gsdoc | 2 +- Documentation/Functions.gsdoc | 2 +- Documentation/ReleaseNotes.gsdoc | 2 +- Documentation/TypesAndConstants.gsdoc | 2 +- Headers/Additions/GNUstepBase/GSFunctions.h | 3 +- Headers/Additions/GNUstepBase/GSObjCRuntime.h | 98 +------------------ Source/Additions/GSObjCRuntime.m | 34 ------- Tools/AGSHtml.m | 14 ++- Tools/AGSOutput.m | 2 +- Tools/AGSParser.m | 2 + Tools/autogsdoc.m | 6 +- 13 files changed, 43 insertions(+), 143 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f0619855..273de05a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2006-10-09 Richard Frith-Macdonald + + * Source/Additions/GSObjCRuntime.m: + * Headers/Additions/GNUstepBase/GSObjCRuntime.h: + Remove previously deprecated functionality. + * Documentation/TypesAndConstants.gsdoc: + * Documentation/ReleaseNotes.gsdoc: + * Documentation/Functions.gsdoc: + * Documentation/BaseAdditions.gsdoc: + * Documentation/Base.gsdoc: + * ChangeLog: + * Tools/AGSHtml.m: + * Tools/AGSParser.m: + * Tools/autogsdoc.m: + * Tools/AGSOutput.m: + Update/improve version/deprecation reporting. + 2006-10-09 Richard Frith-Macdonald * Headers/Additions/GNUstepBase/unicode: diff --git a/Documentation/Base.gsdoc b/Documentation/Base.gsdoc index f348ee9c2..1640b184d 100644 --- a/Documentation/Base.gsdoc +++ b/Documentation/Base.gsdoc @@ -1,5 +1,5 @@ - + " + this->cp+=3; + while(this->cp < this->cend-3 && strncmp((char *)this->cp, "-->", 3) != 0) + this->cp++; // search + // if _del responds to parser: foundComment: + // convert to string (tp+4 ... cp) + this->cp+=3; // might go beyond cend but does not care + vp = this->cp; // value might continue + c = cget(); // get first character behind comment + continue; + } + c = cget(); // get first character of tag + if (c == '/') + c = cget(); // closing tag should process this tag in a special way so that e.g. is read as a single tag! + // to do this properly, we need a notion of comments and quoted string constants... + } + while(!isspace(c) && c != '>' && (c != '/') && (c != '?')) + c = cget(); // scan tag until we find a delimiting character + if (*tp == '/') + tag = UTF8STR(tp + 1, this->cp - tp - 2); // don't include / and delimiting character + else + tag = UTF8STR(tp, this->cp - tp - 1); // don't include delimiting character +#if 0 + NSLog(@"tag=%@ - %02x %c", tag, c, isprint(c)?c: ' '); +#endif + parameters=[NSMutableDictionary dictionaryWithCapacity: 5]; + while(c != EOF) + { +// collect arguments + if (c == '/' && *tp != '/') + { +// appears to be a /> + c = cget(); + if (c != '>') + return [self _parseError: @""]; + [self _processTag: tag isEnd: NO withAttributes: parameters]; // opening tag + [self _processTag: tag isEnd: YES withAttributes: nil]; // closing tag + break; // done + } + if (c == '?' && *tp == '?') + { +// appears to be a ?> + c = cget(); + if (c != '>') + return [self _parseError: @""]; + // process + [self _processTag: tag isEnd: NO withAttributes: parameters]; // single + break; // done + } + while(isspace(c)) // this->should also allow for line break and tab + c = cget(); + if (c == '>') + { + [self _processTag: tag isEnd: (*tp=='/') withAttributes: parameters]; // handle tag + break; + } + arg=[self _qarg]; // get next argument (eats up to /, ?, >, =, space) +#if 0 + NSLog(@"arg=%@", arg); +#endif + if (!this->acceptHTML && [arg length] == 0) + return [self _parseError: @"empty attribute name"]; + c = cget(); // get delimiting character + if (c == '=') + { +// explicit assignment + c = cget(); // skip = + [parameters setObject: [self _qarg] forKey: arg]; + c = cget(); // get character behind qarg value + } + else // implicit + [parameters setObject: @"" forKey: arg]; + } + vp = this->cp; // prepare for next value + c = cget(); // skip > and fetch next character + } + } + } + return [self _parseError: @"this->aborted"]; // this->aborted +} + +- (BOOL) acceptsHTML +{ + return this->acceptHTML; +} + +- (BOOL) shouldProcessNamespaces +{ + return this->shouldProcessNamespaces; +} + +- (BOOL) shouldReportNamespacePrefixes +{ + return this->shouldReportNamespacePrefixes; +} + +- (BOOL) shouldResolveExternalEntities +{ + return this->shouldResolveExternalEntities; +} + +- (void) setShouldProcessNamespaces: (BOOL)flag +{ + this->shouldProcessNamespaces = flag; +} + +- (void) setShouldReportNamespacePrefixes: (BOOL)flag +{ + this->shouldReportNamespacePrefixes = flag; +} + +- (void) setShouldResolveExternalEntities: (BOOL)flag +{ + this->shouldProcessNamespaces = flag; +} + +- (void) _setAcceptHTML: (BOOL) flag +{ + this->acceptHTML = flag; +} + +- (NSString *) publicID +{ + return [self notImplemented: _cmd]; +} + +- (NSString *) systemID +{ + return [self notImplemented: _cmd]; +} + +@end + +#endif + @implementation NSObject (NSXMLParserDelegateEventAdditions) - (NSData*) parser: (NSXMLParser*)aParser resolveExternalEntityName: (NSString*)aName From 513e5b6722fe2366def900ec7d57d8d3b2c4f447 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 27 Dec 2006 08:16:37 +0000 Subject: [PATCH 132/266] Support xml property list parsing when libxml2 is not available. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24266 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 ++ Source/NSPropertyList.m | 322 ++++++++++++++++++++++++++++++++++++++-- Source/NSUserDefaults.m | 6 +- Source/NSXMLParser.m | 132 ++++++++-------- 4 files changed, 393 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2b51dae2..5c869aec6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-12-27 Richard Frith-Macdonald + + * Source/NSUserDefaults.m: remove old defaults as housekeeping + observer when we reset. + * Source/NSXMLParser.m: deactivate some log messages + * Source/NSPropertyList.m: add proplist parser using NSXMLParser + to support parsing of MacOS-X property lists even when libxml2 + is not available. + 2006-12-26 Dr. H. Nikolaus Schaller, Richard Frith-Macdonald * Source/NSXMLParser.m: Implement reduced functionality parser if diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index 5fe2aef17..9d7767ac7 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -44,6 +44,7 @@ #include "Foundation/NSUserDefaults.h" #include "Foundation/NSValue.h" #include "Foundation/NSDebug.h" +#include "Foundation/NSXMLParser.h" #include "GNUstepBase/Unicode.h" #include "GSPrivate.h" @@ -54,6 +55,270 @@ extern BOOL GSScanDouble(unichar*, unsigned, double*); @interface GSMutableDictionary : NSObject // Help the compiler @end + +@interface GSXMLPListParser : NSObject +{ + NSXMLParser *theParser; + NSMutableString *value; + NSMutableArray *stack; + NSString *key; + BOOL inArray; + BOOL inDictionary; + id plist; + NSPropertyListMutabilityOptions opts; +} + +- (id) initWithData: (NSData*)data + mutability: (NSPropertyListMutabilityOptions)options; +- (BOOL) parse; +- (void) parser: (NSXMLParser *)parser + foundCharacters: (NSString *)string; +- (void) parser: (NSXMLParser *)parser + didStartElement: (NSString *)elementName + namespaceURI: (NSString *)namespaceURI + qualifiedName: (NSString *)qualifiedName + attributes: (NSDictionary *)attributeDict; +- (void) parser: (NSXMLParser *)parser + didEndElement: (NSString *)elementName + namespaceURI: (NSString *)namespaceURI + qualifiedName: (NSString *)qName; +- (id) result; +@end + +@implementation GSXMLPListParser + +- (void) dealloc +{ + RELEASE(key); + RELEASE(stack); + RELEASE(plist); + RELEASE(value); + RELEASE(theParser); + [super dealloc]; +} + +- (id) initWithData: (NSData*)data + mutability: (NSPropertyListMutabilityOptions)options +{ + if ((self = [super init]) != nil) + { + stack = [[NSMutableArray alloc] initWithCapacity: 10]; + theParser = [[NSXMLParser alloc] initWithData: data]; + [theParser setDelegate: self]; + opts = options; + } + return self; +} + +- (void) parser: (NSXMLParser *)parser + foundCharacters: (NSString *)string +{ + if (value == nil) + { + value = [[NSMutableString alloc] initWithCapacity: 50]; + } + [value appendString: string]; +} + +- (void) parser: (NSXMLParser *)parser + didStartElement: (NSString *)elementName + namespaceURI: (NSString *)namespaceURI + qualifiedName: (NSString *)qualifiedName + attributes: (NSDictionary *)attributeDict +{ + if ([elementName isEqualToString: @"dict"] == YES) + { + NSMutableDictionary *d; + + d = [[NSMutableDictionary alloc] initWithCapacity: 10]; + [stack addObject: d]; + RELEASE(d); + inDictionary = YES; + inArray = NO; + } + else if ([elementName isEqualToString: @"array"] == YES) + { + NSMutableArray *a; + + a = [[NSMutableArray alloc] initWithCapacity: 10]; + [stack addObject: a]; + RELEASE(a); + inArray = YES; + inDictionary = NO; + } +} + +- (void) parser: (NSXMLParser *)parser + didEndElement: (NSString *)elementName + namespaceURI: (NSString *)namespaceURI + qualifiedName: (NSString *)qName +{ + BOOL inContainer = NO; + + if ([elementName isEqualToString: @"dict"] == YES) + { + inContainer = YES; + } + if ([elementName isEqualToString: @"array"] == YES) + { + inContainer = YES; + } + + if (inContainer) + { + if (opts != NSPropertyListImmutable) + { + ASSIGN(plist, [stack lastObject]); + } + else + { + ASSIGN(plist, [[stack lastObject] makeImmutableCopyOnFail: NO]); + } + inArray = NO; + inDictionary = NO; + if ([stack count] > 0) + { + id last; + + [stack removeLastObject]; + last = [stack lastObject]; + if ([last isKindOfClass: [NSArray class]] == YES) + { + inArray = YES; + } + else if ([last isKindOfClass: [NSDictionary class]] == YES) + { + inDictionary = YES; + } + } + } + else if ([elementName isEqualToString: @"key"] == YES) + { + ASSIGN(key, [value makeImmutableCopyOnFail: NO]); + DESTROY(value); + return; + } + else if ([elementName isEqualToString: @"data"]) + { + NSData *d; + + d = [GSMimeDocument decodeBase64: + [value dataUsingEncoding: NSASCIIStringEncoding]]; + if (opts == NSPropertyListMutableContainersAndLeaves) + { + d = AUTORELEASE([d mutableCopy]); + } + ASSIGN(plist, d); + if (d == nil) + { + [parser abortParsing]; + return; + } + } + else if ([elementName isEqualToString: @"date"]) + { + id result; + + if ([value hasSuffix: @"Z"] == YES && [value length] == 20) + { + result = [NSCalendarDate dateWithString: value + calendarFormat: @"%Y-%m-%dT%H:%M:%SZ"]; + } + else + { + result = [NSCalendarDate dateWithString: value + calendarFormat: @"%Y-%m-%d %H:%M:%S %z"]; + } + ASSIGN(plist, result); + } + else if ([elementName isEqualToString: @"string"]) + { + id o; + + if (opts == NSPropertyListMutableContainersAndLeaves) + { + if (value == nil) + { + o = [NSMutableString string]; + } + else + { + o = value; + } + } + else + { + if (value == nil) + { + o = @""; + } + else + { + o = [value makeImmutableCopyOnFail: NO]; + } + } + ASSIGN(plist, o); + } + else if ([elementName isEqualToString: @"integer"]) + { + ASSIGN(plist, [NSNumber numberWithInt: [value intValue]]); + } + else if ([elementName isEqualToString: @"real"]) + { + ASSIGN(plist, [NSNumber numberWithDouble: [value doubleValue]]); + } + else if ([elementName isEqualToString: @"true"]) + { + ASSIGN(plist, [NSNumber numberWithBool: YES]); + } + else if ([elementName isEqualToString: @"false"]) + { + ASSIGN(plist, [NSNumber numberWithBool: NO]); + } + else if ([elementName isEqualToString: @"plist"]) + { + DESTROY(value); + return; + } + else // invalid tag + { + NSLog(@"unrecognized tag <%@>", elementName); + [parser abortParsing]; + return; + } + + if (inArray == YES) + { + [[stack lastObject] addObject: plist]; + } + else if (inDictionary == YES) + { + if (key == nil) + { + [parser abortParsing]; + return; + } + [[stack lastObject] setObject: plist forKey: key]; + DESTROY(key); + } + DESTROY(value); +} + +- (BOOL) parse +{ + return [theParser parse]; +} + +- (id) result +{ + return plist; +} + +@end + + + + @interface GSBinaryPLParser : NSObject { NSPropertyListMutabilityOptions mutability; @@ -1877,16 +2142,35 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step, [keyArray getObjects: keys]; } - for (i = 0; i < numKeys; i++) - { - if (GSObjCClass(keys[i]) == lastClass) - continue; - if ([keys[i] respondsToSelector: @selector(compare:)] == NO) + if (x == NSPropertyListXMLFormat_v1_0) + { + /* This format can only use strings as keys. + */ + lastClass = [NSString class]; + for (i = 0; i < numKeys; i++) { - canCompare = NO; - break; + if ([keys[i] isKindOfClass: lastClass] == NO) + { + [NSException raise: NSInvalidArgumentException + format: @"Bad key in property list: '%@'", keys[i]]; + } + } + } + else + { + /* All keys must respond to -compare: for sorting. + */ + for (i = 0; i < numKeys; i++) + { + if (GSObjCClass(keys[i]) == lastClass) + continue; + if ([keys[i] respondsToSelector: @selector(compare:)] == NO) + { + canCompare = NO; + break; + } + lastClass = GSObjCClass(keys[i]); } - lastClass = GSObjCClass(keys[i]); } if (canCompare == YES) @@ -2070,7 +2354,7 @@ static BOOL classInitialized = NO; { classInitialized = YES; -#ifdef HAVE_LIBXML +#if HAVE_LIBXML /* * Cache XML node information. */ @@ -2278,9 +2562,6 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml, { // It begins with '_tempDomains objectForKey: NSRegistrationDomain]); - + /* To ensure that we don't try to synchronise the old defaults to disk + * after creating the new ones, remove as housekeeping notification + * observer. + */ + [[NSNotificationCenter defaultCenter] removeObserver: sharedDefaults]; setSharedDefaults = NO; DESTROY(sharedDefaults); if (regDefs != nil) diff --git a/Source/NSXMLParser.m b/Source/NSXMLParser.m index b8fcf3235..74557ed04 100644 --- a/Source/NSXMLParser.m +++ b/Source/NSXMLParser.m @@ -584,83 +584,93 @@ typedef struct NSXMLParserIvarsType isEnd: (BOOL)flag withAttributes: (NSDictionary *)attributes { -#if 0 - NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); -#endif if (this->acceptHTML) tag = [tag lowercaseString]; // not case sensitive if (!flag) { if ([tag isEqualToString: @"?xml"]) { - // parse, i.e. check for UTF8 encoding and other attributes - #if 0 - NSLog(@"parserDidStartDocument: "); - #endif - if ([_del respondsToSelector: @selector(parserDidStartDocument:)]) - [_del parserDidStartDocument: self]; - return; +#if 0 +NSLog(@"parserDidStartDocument: "); +#endif + if ([_del respondsToSelector: @selector(parserDidStartDocument:)]) + [_del parserDidStartDocument: self]; + return; } if ([tag hasPrefix: @"?"]) { - #if 1 - NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); - #endif - // parser: foundProcessingInstructionWithTarget: data: - return; +#if 0 +NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); +#endif + // parser: foundProcessingInstructionWithTarget: data: + return; } if ([tag isEqualToString: @"!DOCTYPE"]) { - // parse and might load - #if 1 - NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); - #endif - return; +#if 0 +NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); +#endif + return; } if ([tag isEqualToString: @"!ENTITY"]) { - // parse - #if 1 - NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); - #endif - return; +#if 0 +NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); +#endif + return; } if ([tag isEqualToString: @"!CDATA"]) { // pass through as NSData // parser: foundCDATA: - #if 1 - NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); - #endif +#if 0 +NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); +#endif return; } [this->tagPath addObject: tag]; // push on stack - if ([_del respondsToSelector:@selector(parser:didStartElement:namespaceURI:qualifiedName:attributes:)]) - [_del parser: self didStartElement: tag namespaceURI: nil qualifiedName: nil attributes: attributes]; - } + if ([_del respondsToSelector: + @selector(parser:didStartElement:namespaceURI:qualifiedName:attributes:)]) + [_del parser: self + didStartElement: tag + namespaceURI: nil + qualifiedName: nil + attributes: attributes]; + } else { // closing tag - if (this->acceptHTML) - { -// lazily close any missing tags on stack - while([this->tagPath count] > 0 && ![[this->tagPath lastObject] isEqualToString: tag]) // must be literally equal! - { - if ([_del respondsToSelector: @selector(parser: didEndElement: namespaceURI: qualifiedName: )]) - [_del parser: self didEndElement: [this->tagPath lastObject] namespaceURI: nil qualifiedName: nil]; - [this->tagPath removeLastObject]; // pop from stack - } - if ([this->tagPath count] == 0) - return; // ignore closing tag without matching open... - } - else if (![[this->tagPath lastObject] isEqualToString: tag]) // must be literally equal! - { - [self _parseError: [NSString stringWithFormat: @"tag nesting error ( expected, found)", [this->tagPath lastObject], tag]]; - return; - } - if ([_del respondsToSelector: @selector(parser: didEndElement: namespaceURI: qualifiedName: )]) - [_del parser: self didEndElement: tag namespaceURI: nil qualifiedName: nil]; - [this->tagPath removeLastObject]; // pop from stack + if (this->acceptHTML) + { + // lazily close any missing tags on stack + while ([this->tagPath count] > 0 + && ![[this->tagPath lastObject] isEqualToString: tag]) + { + if ([_del respondsToSelector: + @selector(parser:didEndElement:namespaceURI:qualifiedName:)]) + [_del parser: self + didEndElement: [this->tagPath lastObject] + namespaceURI: nil + qualifiedName: nil]; + [this->tagPath removeLastObject]; // pop from stack + } + if ([this->tagPath count] == 0) + return; // ignore closing tag without matching open... + } + else if (![[this->tagPath lastObject] isEqualToString: tag]) + { + [self _parseError: [NSString stringWithFormat: + @"tag nesting error ( expected, found)", + [this->tagPath lastObject], tag]]; + return; + } + if ([_del respondsToSelector: + @selector(parser:didEndElement:namespaceURI:qualifiedName:)]) + [_del parser: self + didEndElement: tag + namespaceURI: nil + qualifiedName: nil]; + [this->tagPath removeLastObject]; // pop from stack } } @@ -675,7 +685,7 @@ typedef struct NSXMLParserIvarsType do { c = cget(); - } while(c != EOF && c != '<' && c != ';'); + } while (c != EOF && c != '<' && c != ';'); if (c != ';') return nil; // invalid sequence - end of file or missing ; before next tag @@ -729,7 +739,7 @@ typedef struct NSXMLParserIvarsType c = cget(); if (c == EOF) return nil; // unterminated! - } while(c != '\"'); + } while (c != '\"'); return UTF8STR(ap + 1, this->cp - ap - 2); } if (c == '\'') @@ -739,12 +749,12 @@ typedef struct NSXMLParserIvarsType c = cget(); if (c == EOF) return nil; // unterminated! - } while(c != '\''); + } while (c != '\''); return UTF8STR(ap + 1, this->cp - ap - 2); } if (!this->acceptHTML) ; // strict XML requires quoting (?) - while(!isspace(c) && c != '>' && c != '/' && c != '?' && c != '=' &&c != EOF) + while (!isspace(c) && c != '>' && c != '/' && c != '?' && c != '=' &&c != EOF) c = cget(); this->cp--; // go back to terminating character return UTF8STR(ap, this->cp - ap); @@ -764,7 +774,7 @@ typedef struct NSXMLParserIvarsType return [self _parseError: @"missing preamble"]; } c = cget(); // get first character - while(!this->abort) + while (!this->abort) { // parse next element #if 0 @@ -803,7 +813,7 @@ typedef struct NSXMLParserIvarsType { if (!this->acceptHTML) return [self _parseError: @"unexpected end of file"]; // strict XML nesting error - while([this->tagPath count] > 0) + while ([this->tagPath count] > 0) { // lazily close all open tags if ([_del respondsToSelector: @selector(parser: didEndElement: namespaceURI: qualifiedName: )]) @@ -842,7 +852,7 @@ typedef struct NSXMLParserIvarsType { // start of comment skip all characters until "-->" this->cp+=3; - while(this->cp < this->cend-3 && strncmp((char *)this->cp, "-->", 3) != 0) + while (this->cp < this->cend-3 && strncmp((char *)this->cp, "-->", 3) != 0) this->cp++; // search // if _del responds to parser: foundComment: // convert to string (tp+4 ... cp) @@ -862,7 +872,7 @@ typedef struct NSXMLParserIvarsType // FIXME: this->should process this tag in a special way so that e.g. is read as a single tag! // to do this properly, we need a notion of comments and quoted string constants... } - while(!isspace(c) && c != '>' && (c != '/') && (c != '?')) + while (!isspace(c) && c != '>' && (c != '/') && (c != '?')) c = cget(); // scan tag until we find a delimiting character if (*tp == '/') tag = UTF8STR(tp + 1, this->cp - tp - 2); // don't include / and delimiting character @@ -872,7 +882,7 @@ typedef struct NSXMLParserIvarsType NSLog(@"tag=%@ - %02x %c", tag, c, isprint(c)?c: ' '); #endif parameters=[NSMutableDictionary dictionaryWithCapacity: 5]; - while(c != EOF) + while (c != EOF) { // collect arguments if (c == '/' && *tp != '/') @@ -895,7 +905,7 @@ typedef struct NSXMLParserIvarsType [self _processTag: tag isEnd: NO withAttributes: parameters]; // single break; // done } - while(isspace(c)) // this->should also allow for line break and tab + while (isspace(c)) // this->should also allow for line break and tab c = cget(); if (c == '>') { From 05a4bb282955e2aed78fd7b118e32461f7832553 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 27 Dec 2006 14:11:14 +0000 Subject: [PATCH 133/266] Initial attempt at integration of NSNetServices support. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24272 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 13 + Headers/Additions/GNUstepBase/config.h.in | 3 + Headers/Foundation/Foundation.h | 1 + Headers/Foundation/NSNetServices.h | 438 ++ Source/GNUmakefile | 6 + Source/NSNetServices.m | 3318 ++++++++++++++++ base.make.in | 1 + configure | 4385 ++++++--------------- configure.ac | 14 + 9 files changed, 4999 insertions(+), 3180 deletions(-) create mode 100644 Headers/Foundation/NSNetServices.h create mode 100644 Source/NSNetServices.m diff --git a/ChangeLog b/ChangeLog index 5c869aec6..e621fa6ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-12-27 Chris B. Vetter + + * Headers/Foundation/NSNetServices.h: New class + * Source/NSNetServices.m: New class + * Source/GNUmakefile: Build NSNetServices if dns_sd is available. + * configure.ac: Check for usability of dns_sd + * Headers/Foundation/Foundation.h: Include NSNetServices.h + * Headers/Additions/GNUstepBase/config.h.in: add dns_sd availability + * base.make.in: add dns_sd availability + * configure: regenerate + Support for NSNetServices implemented by Chris. + Integrated by Richard (untested). + 2006-12-27 Richard Frith-Macdonald * Source/NSUserDefaults.m: remove old defaults as housekeeping diff --git a/Headers/Additions/GNUstepBase/config.h.in b/Headers/Additions/GNUstepBase/config.h.in index 2b3194b54..926c347bb 100644 --- a/Headers/Additions/GNUstepBase/config.h.in +++ b/Headers/Additions/GNUstepBase/config.h.in @@ -157,6 +157,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MDNS_SD_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/Headers/Foundation/Foundation.h b/Headers/Foundation/Foundation.h index 8705c8679..6bfbe9216 100644 --- a/Headers/Foundation/Foundation.h +++ b/Headers/Foundation/Foundation.h @@ -79,6 +79,7 @@ #import #import #import +#import #import #import #import diff --git a/Headers/Foundation/NSNetServices.h b/Headers/Foundation/NSNetServices.h new file mode 100644 index 000000000..102e92ff0 --- /dev/null +++ b/Headers/Foundation/NSNetServices.h @@ -0,0 +1,438 @@ +/* Interface for NSNetServices for GNUstep + Copyright (C) 2006 Free Software Foundation, Inc. + + Written by: Chris B. Vetter + Date: 2006 + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. + */ + +#ifndef __NSNetServices_h_GNUSTEP_BASE_INCLUDE +#define __NSNetServices_h_GNUSTEP_BASE_INCLUDE +#import + +#import +#import + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef enum +{ + /** + * + * + * NSNetServicesUnknownError
+ * An unknown error occurred. + *

+ *
+ * + * NSNetServicesCollisionError
+ * The given registration has had a name collision. Registration should + * be cancelled and tried again with a different name. + *

+ *
+ * + * NSNetServicesNotFoundError
+ * The service could not be found. + *

+ *
+ * + * NSNetServicesActivityInProgress
+ * A request is already in progress. + *

+ *
+ * + * NSNetServicesBadArgumentError
+ * An invalid argument was used to create the object. + *

+ *
+ * + * NSNetServicesCancelledError
+ * The request has been cancelled. + *

+ *
+ * + * NSNetServicesInvalidError
+ * The service was improperly configured. + *

+ *
+ * + * NSNetServicesTimeoutError
+ * The request has timed out before a successful resolution. + *

+ *
+ *
+ */ + NSNetServicesUnknownError = -72000L, + NSNetServicesCollisionError = -72001L, + NSNetServicesNotFoundError = -72002L, + NSNetServicesActivityInProgress = -72003L, + NSNetServicesBadArgumentError = -72004L, + NSNetServicesCancelledError = -72005L, + NSNetServicesInvalidError = -72006L, + NSNetServicesTimeoutError = -72007L +} NSNetServicesError; + +GS_EXPORT NSString * const NSNetServicesErrorCode; +GS_EXPORT NSString * const NSNetServicesErrorDomain; + +@class NSInputStream; +@class NSOutputStream; +@class NSRunLoop; + +/** + * + * + * NSNetService class description + * + *

+ * + *

+ * + *

+ * + *

+ *
+ *

+ * [NSNetService] lets you publish a network service in a domain using + * multicast DNS. Additionally, it lets you resolve a network service that + * was discovered by [NSNetServiceBrowser]. + *

+ */ + +@interface NSNetService : NSObject +{ + @private + void * _netService; + id _delegate; + void * _reserved; +} + ++ (NSData *) dataFromTXTRecordDictionary: (NSDictionary *) txtDictionary; ++ (NSDictionary *) dictionaryFromTXTRecordData: (NSData *) txtData; + +- (id) initWithDomain: (NSString *) domain + type: (NSString *) type + name: (NSString *) name; +- (id) initWithDomain: (NSString *) domain + type: (NSString *) type + name: (NSString *) name + port: (int) port; + +- (void) removeFromRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode; +- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode; + +- (void) publish; +- (void) resolve; +- (void) resolveWithTimeout: (NSTimeInterval) timeout; +- (void) stop; + +- (void) startMonitoring; +- (void) stopMonitoring; + +- (id) delegate; +- (void) setDelegate: (id) delegate; + +- (NSArray *) addresses; +- (NSString *) domain; +- (NSString *) hostName; +- (NSString *) name; +- (NSString *) type; + +- (NSString *) protocolSpecificInformation; +- (void) setProtocolSpecificInformation: (NSString *) specificInformation; + +- (NSData *) TXTRecordData; +- (BOOL) setTXTRecordData: (NSData *) recordData; + +- (BOOL) getInputStream: (NSInputStream **) inputStream + outputStream: (NSOutputStream **) outputStream; + +@end + +/** + * + * + * NSNetServiceBrowser class description + * + *

+ * + *

+ * + *

+ * + *

+ *
+ *

+ * [NSNetServiceBrowser] asynchronously lets you discover network domains + * and, additionally, search for a type of network service. It sends its + * delegate a message whenever it discovers a new network service, and + * whenever a network service goes away. + *

+ *

+ * Each [NSNetServiceBrowser] performs one search at a time. So in order + * to perform multiple searches simultaneously, create multiple instances. + *

+ */ + +@interface NSNetServiceBrowser : NSObject +{ + @private + void * _netServiceBrowser; + id _delegate; + void * _reserved; +} + +- (id) init; + +- (void) removeFromRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode; +- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode; + +- (void) searchForAllDomains; +- (void) searchForBrowsableDomains; +- (void) searchForRegistrationDomains; + +- (void) searchForServicesOfType: (NSString *) serviceType + inDomain: (NSString *) domainName; + +- (void) stop; + +- (id) delegate; +- (void) setDelegate: (id) delegate; + +@end + +/** + * + * + * NSObject (NSNetServiceDelegateMethods) class description + * + *

+ * + *

+ * + *

+ * + *

+ *
+ *

+ * This informal protocol must be adopted by any class wishing to implement + * an [NSNetService] delegate. + *

+ */ + +@interface NSObject (NSNetServiceDelegateMethods) + +/** + * Notifies the delegate that the network is ready to publish the service. + * + *

See also:
+ * [NSNetService-publish]
+ *

+ */ + +- (void) netServiceWillPublish: (NSNetService *) sender; + +/** + * Notifies the delegate that the service was successfully published. + * + *

See also:
+ * [NSNetService-publish]
+ *

+ */ + +- (void) netServiceDidPublish: (NSNetService *) sender; + +/** + * Notifies the delegate that the service could not get published. + * + *

See also:
+ * [NSNetService-publish]
+ *

+ */ + +- (void) netService: (NSNetService *) sender + didNotPublish: (NSDictionary *) errorDict; + +/** + * Notifies the delegate that the network is ready to resolve the service. + * + *

See also:
+ * [NSNetService-resolveWithTimeout:]
+ *

+ */ + +- (void) netServiceWillResolve: (NSNetService *) sender; + +/** + * Notifies the delegate that the service was resolved. + * + *

See also:
+ * [NSNetService-resolveWithTimeout:]
+ *

+ */ + +- (void) netServiceDidResolveAddress: (NSNetService *) sender; + +/** + * Notifies the delegate that the service could not get resolved. + * + *

See also:
+ * [NSNetService-resolveWithTimeout:]
+ *

+ */ + +- (void) netService: (NSNetService *) sender + didNotResolve: (NSDictionary *) errorDict; + +/** + * Notifies the delegate that the request was stopped. + * + *

See also:
+ * [NSNetService-stop]
+ *

+ */ + +- (void) netServiceDidStop: (NSNetService *) sender; + +/** + * Notifies the delegate that the TXT record has been updated. + * + *

See also:
+ * [NSNetService-startMonitoring]
+ * [NSNetService-stopMonitoring] + *

+ */ + +- (void) netService: (NSNetService *) sender + didUpdateTXTRecordData: (NSData *) data; + +@end + +/** + * + * + * NSObject (NSNetServiceBrowserDelegateMethods) class description + * + *

+ * + *

+ * + *

+ * + *

+ *
+ *

+ * This informal protocol must be adopted by any class wishing to implement + * an [NSNetServiceBrowser] delegate. + *

+ */ + +@interface NSObject (NSNetServiceBrowserDelegateMethods) + +/** + * Notifies the delegate that the search is about to begin. + * + *

See also:
+ * [NSNetServiceBrowser-netServiceBrowser:didNotSearch:]
+ *

+ */ + +- (void) netServiceBrowserWillSearch: (NSNetServiceBrowser *)aNetServiceBrowser; + +/** + * Notifies the delegate that the search was unsuccessful. + * + *

See also:
+ * [NSNetServiceBrowser-netServiceBrowserWillSearch:]
+ *

+ */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aNetServiceBrowser + didNotSearch: (NSDictionary *) errorDict; + +/** + * Notifies the delegate that the search was stopped. + * + *

See also:
+ * [NSNetServiceBrowser-stop]
+ *

+ */ + +- (void) netServiceBrowserDidStopSearch: + (NSNetServiceBrowser *)aNetServiceBrowser; + +/** + * Notifies the delegate that a domain was found. + * + *

See also:
+ * [NSNetServiceBrowser-searchForBrowsableDomains]
+ * [NSNetServiceBrowser-searchForRegistrationDomains]
+ *

+ */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aNetServiceBrowser + didFindDomain: (NSString *) domainString + moreComing: (BOOL) moreComing; + +/** + * Notifies the delegate that a domain has become unavailable. + * + *

See also:
+ *
+ *

+ */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aNetServiceBrowser + didRemoveDomain: (NSString *) domainString + moreComing: (BOOL) moreComing; + +/** + * Notifies the delegate that a service was found. + * + *

See also:
+ * [NSNetServiceBrowser-searchForServicesOfType:inDomain:]
+ *

+ */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aNetServiceBrowser + didFindService: (NSNetService *) aNetService + moreComing: (BOOL) moreComing; + +/** + * Notifies the delegate that a service has become unavailable. + * + *

See also:
+ *
+ *

+ */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aNetServiceBrowser + didRemoveService: (NSNetService *) aNetService + moreComing: (BOOL) moreComing; + +@end + +#endif /* __NSNetServices_h_GNUSTEP_BASE_INCLUDE */ + diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 966bc86bf..3d85be445 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -255,6 +255,11 @@ BASE_MFILES += \ GSFileHandle.m \ NSMessagePort.m \ NSMessagePortNameServer.m + +ifeq ($(GNUSTEP_BASE_HAVE_MDNS), 1) +BASE_MFILES += NSNetServices.m +endif + endif ifeq ($(WITH_FFI),libffi) @@ -325,6 +330,7 @@ NSKeyValueObserving.h \ NSLock.h \ NSMapTable.h \ NSMethodSignature.h \ +NSNetServices.h \ NSNotification.h \ NSNotificationQueue.h \ NSNull.h \ diff --git a/Source/NSNetServices.m b/Source/NSNetServices.m new file mode 100644 index 000000000..f94fea73b --- /dev/null +++ b/Source/NSNetServices.m @@ -0,0 +1,3318 @@ +/* Implementation for NSNetServices for GNUstep + Copyright (C) 2006 Free Software Foundation, Inc. + + Written by: Chris B. Vetter + Date: 2006 + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. + */ + +#import "Foundation/NSNetServices.h" +#import "Foundation/NSData.h" +#import "Foundation/NSDebug.h" +#import "Foundation/NSNull.h" +#import "Foundation/NSRunLoop.h" +#import "Foundation/NSStream.h" +#import "Foundation/NSTimer.h" +#import "Foundation/NSValue.h" +#import "GNUstepBase/GSLock.h" + +#import // Apple's DNS Service Discovery + +#import +#import // AF_INET / AF_INET6 + +#import // struct sockaddr_in / sockaddr_in6 +#import // inet_pton(3) + +// +// Define +// + +#define PUBLIC /* public */ +#define PRIVATE static +#define EXTERN extern + +#if ! defined(INET6_ADDRSTRLEN) +# define INET6_ADDRSTRLEN 46 +#endif + +// trigger runloop timer every INTERVAL seconds +#define INTERVAL 0.3 +#define SHORTTIMEOUT 0.25 + +// debugging stuff and laziness on my part +#if defined(VERBOSE) +# define INTERNALTRACE NSDebugLLog(@"Trace", @"%s", __PRETTY_FUNCTION__) +# define LOG(f, args...) NSDebugLLog(@"NSNetServices", f, ##args) +#else +# define INTERNALTRACE +# define LOG(f, args...) +#endif /* VERBOSE */ + +#if ! defined(VERSION) +# define VERSION (((GNUSTEP_BASE_MAJOR_VERSION * 100) \ + + GNUSTEP_BASE_MINOR_VERSION) * 100) \ + + GNUSTEP_BASE_SUBMINOR_VERSION +#endif + +#define SETVERSION(aClass) \ + do { \ + if (self == [aClass class]) { [self setVersion: VERSION]; } \ + else { [self doesNotRecognizeSelector: _cmd]; } \ + } while(0); + +#if defined(_REENTRANT) +# define THE_LOCK GSLazyLock *lock +# define CREATELOCK(x) x->lock = [GSLazyLock new] +# define LOCK(x) [x->lock lock] +# define UNLOCK(x) [x->lock unlock] +# define DESTROYLOCK(x) DESTROY(x->lock) +#else +# define THE_LOCK /* nothing */ +# define CREATELOCK(x) /* nothing */ +# define LOCK(x) /* nothing */ +# define UNLOCK(x) /* nothing */ +# define DESTROYLOCK(x) /* nothing */ +#endif + +// +// Typedef +// + +typedef struct _Browser // The actual NSNetServiceBrowser +{ + THE_LOCK; + + NSRunLoop *runloop; + NSString *runloopmode; + NSTimer *timer; // to control the runloop + + NSMutableDictionary *services; + // List of found services. + // Key is <_name_type_domain> and value is an initialized NSNetService. + + int interfaceIndex; +} Browser; + +typedef struct _Service // The actual NSNetService +{ + THE_LOCK; + + NSRunLoop *runloop; + NSString *runloopmode; + NSTimer *timer, // to control the runloop + *timeout; // to time-out the resolve + + NSMutableDictionary *info; + // The service's information, keys are + // - Domain (string) + // - Name (string) + // - Type (string) + // - Host (string) + // - Addresses (mutable array) + // - TXT (data) + + NSMutableArray *foundAddresses; // array of char* + + int interfaceIndex, // should also be in 'info' + port; // ditto + + id monitor; // NSNetServiceMonitor + + BOOL isPublishing, // true if publishing service + isMonitoring; // true if monitoring +} Service; + +typedef struct _Monitor // The actual NSNetServiceMonitor +{ + THE_LOCK; + + NSRunLoop *runloop; + NSString *runloopmode; + NSTimer *timer; // to control the runloop +} Monitor; + +// +// Public +// + +/** + * This key identifies the most recent error. + */ +NSString * const NSNetServicesErrorCode = @"NSNetServicesErrorCode"; + +/** + * This key identifies the originator of the error. + */ +NSString * const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; + +// +// Private +// + +// +// Private Interface +// + +@interface NSNetServiceMonitor : NSObject +{ + @private + void * _netServiceMonitor; + id _delegate; + void * _reserved; +} + +- (id) initWithDelegate: (id) delegate; + +- (void) removeFromRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode; +- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode; + +- (void) start; +- (void) stop; + +@end + +// +// Prototype +// + +PRIVATE NSDictionary + *CreateError(id sender, + int errorCode); + +PRIVATE int + ConvertError(int errorCode); + +PRIVATE void DNSSD_API + // used by NSNetServiceBrowser + EnumerationCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *replyDomain, + void *context), + BrowserCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *replyName, + const char *replyType, + const char *replyDomain, + void *context), + // used by NSNetService + ResolverCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *fullname, + const char *hosttarget, + uint16_t port, + uint16_t txtLen, + const char *txtRecord, + void *context), + RegistrationCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + DNSServiceErrorType errorCode, + const char *name, + const char *regtype, + const char *domain, + void *context), + // used by NSNetService and NSNetServiceMonitor + QueryCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *fullname, + uint16_t rrtype, + uint16_t rrclass, + uint16_t rdlen, + const void *rdata, + uint32_t ttl, + void *context); + +/*************************************************************************** +** +** Implementation +** +*/ + +@implementation NSNetServiceBrowser + +/** + * Description forthcoming + * + * + */ + ++ (void) initialize +{ + INTERNALTRACE; + + SETVERSION(NSNetServiceBrowser); + { +#ifndef _REENTRANT + LOG(@"%@ may NOT be thread-safe!", [self class]); +#endif + } +} + +/*************************************************************************** +** +** Private Methods +** +*/ + +/** + * Description forthcoming + * + * + */ + +- (void) cleanup +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + if (browser->runloop) + { + [self removeFromRunLoop: browser->runloop + forMode: browser->runloopmode]; + } + + if (browser->timer) + { + [browser->timer invalidate]; + DESTROY(browser->timer); + } + + if (_netServiceBrowser) + { + DNSServiceRefDeallocate(_netServiceBrowser); + _netServiceBrowser = NULL; + } + + [browser->services removeAllObjects]; + } + UNLOCK(browser); +} + +/** + * Description forthcoming + * + * + */ + +- (void) executeWithError: (DNSServiceErrorType) err +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + if (kDNSServiceErr_NoError == err) + { + [self netServiceBrowserWillSearch: self]; + + if (! browser->runloop) + { + [self scheduleInRunLoop: [NSRunLoop currentRunLoop] + forMode: NSDefaultRunLoopMode]; + } + + [browser->runloop addTimer: browser->timer + forMode: browser->runloopmode]; + + [browser->timer fire]; + } + else // notify the delegate of the error + { + [self netServiceBrowser: self + didNotSearch: CreateError(self, err)]; + } + } + UNLOCK(browser); +} + +/** + * Description forthcoming + * + * + */ + +- (void) searchForDomain: (int) aFlag +{ + DNSServiceErrorType err = kDNSServiceErr_NoError; + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + do + { + if (! _delegate) + { + err = NSNetServicesInvalidError; + break; + } + + if (browser->timer) + { + err = NSNetServicesActivityInProgress; + break; + } + + err = DNSServiceEnumerateDomains((DNSServiceRef *)&_netServiceBrowser, + aFlag, + browser->interfaceIndex, + EnumerationCallback, + self); + } + while(0); + } + UNLOCK(browser); + + [self executeWithError: err]; +} + +/** + * Description forthcoming + * + * + */ + +- (void) enumCallback: (DNSServiceRef) sdRef + flags: (DNSServiceFlags) flags + interface: (uint32_t) interfaceIndex + error: (DNSServiceErrorType) errorCode + domain: (const char *) replyDomain +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + + if (_netServiceBrowser) + { + if (errorCode) + { + [self cleanup]; + + [self netServiceBrowser: self + didNotSearch: CreateError(self, errorCode)]; + } + else + { + BOOL more = NO; + + if (replyDomain) + { + NSString *domain; + + more = flags & kDNSServiceFlagsMoreComing; + + browser->interfaceIndex = interfaceIndex; + + domain = [NSString stringWithUTF8String: replyDomain]; + + if (flags & kDNSServiceFlagsAdd) + { + LOG(@"Found domain <%s>", replyDomain); + + [self netServiceBrowser: self + didFindDomain: domain + moreComing: more]; + } + else // kDNSServiceFlagsRemove + { + LOG(@"Removed domain <%s>", replyDomain); + + [self netServiceBrowser: self + didRemoveDomain: domain + moreComing: more]; + } + } + } + } + UNLOCK(browser); +} + +/** + * Description forthcoming + * + * + */ + +- (void) browseCallback: (DNSServiceRef) sdRef + flags: (DNSServiceFlags) flags + interface: (uint32_t) interfaceIndex + error: (DNSServiceErrorType) errorCode + name: (const char *) replyName + type: (const char *) replyType + domain: (const char *) replyDomain +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + + if (_netServiceBrowser) + { + if (errorCode) + { + [self cleanup]; + + [self netServiceBrowser: self + didNotSearch: CreateError(self, errorCode)]; + } + else + { + NSNetService *service = nil; + NSString *domain = nil; + NSString *type = nil; + NSString *name = nil; + NSString *key = nil; + BOOL more = (flags & kDNSServiceFlagsMoreComing); + + browser->interfaceIndex = interfaceIndex; + + if (nil == browser->services) + { + browser->services + = [[NSMutableDictionary alloc] initWithCapacity: 1]; + } + + domain = [NSString stringWithUTF8String: replyDomain]; + type = [NSString stringWithUTF8String: replyType]; + name = [NSString stringWithUTF8String: replyName]; + + key = [NSString stringWithFormat: @"%@%@%@", name, type, domain]; + + if (flags & kDNSServiceFlagsAdd) + { + service = [[NSNetService alloc] initWithDomain: domain + type: type + name: name]; + + if (service) + { + LOG(@"Found service <%s>", replyName); + + [self netServiceBrowser: self + didFindService: service + moreComing: more]; + + [browser->services setObject: service + forKey: key]; + + [service autorelease]; + } + else + { + LOG(@"WARNING: Could not create an NSNetService for <%s>", + replyName); + } + } + else // kDNSServiceFlagsRemove + { + service = [browser->services objectForKey: key]; + + if (service) + { + LOG(@"Removed service <%@>", [service name]); + + [self netServiceBrowser: self + didRemoveService: service + moreComing: more]; + } + else + { + LOG(@"WARNING: Could not find <%@> in list", key); + } + } + } + } + UNLOCK(browser); +} + +/** + * Description forthcoming + * + * + */ + +- (void) loop: (id) sender +{ + int sock = 0; + struct timeval tout = { 0 }; + fd_set set; + DNSServiceErrorType err = kDNSServiceErr_NoError; + + sock = DNSServiceRefSockFD(_netServiceBrowser); + + if (-1 != sock) + { + FD_ZERO(&set); + FD_SET(sock, &set); + + if (1 == select(sock + 1, &set, (fd_set *) NULL, (fd_set *) NULL, &tout)) + { + err = DNSServiceProcessResult(_netServiceBrowser); + } + } + + if (kDNSServiceErr_NoError != err) + { + [self netServiceBrowser: self + didNotSearch: CreateError(self, err)]; + } +} + +/** + * Removes the receiver from the specified runloop. + * + * + */ +- (void) removeFromRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + if (browser->timer) + { + [browser->timer setFireDate: [NSDate date]]; + [browser->timer invalidate]; + browser->timer = nil; + } + + // Do not release the runloop! + browser->runloop = nil; + + DESTROY(browser->runloopmode); + } + UNLOCK(browser); +} + +/** + * Adds the receiver to the specified runloop. + * + * + */ + +- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + if (browser->timer) + { + [browser->timer setFireDate: [NSDate date]]; + [browser->timer invalidate]; + browser->timer = nil; + } + + browser->timer = [NSTimer timerWithTimeInterval: INTERVAL + target: self + selector: @selector(loop:) + userInfo: nil + repeats: YES]; + + browser->runloop = aRunLoop; + browser->runloopmode = mode; + + [browser->timer retain]; + } + UNLOCK(browser); +} + +/** + * Search for all visible domains. This method is deprecated. + * + * + */ + +- (void) searchForAllDomains +{ + DNSServiceFlags flags = 0; + + INTERNALTRACE; + + flags = kDNSServiceFlagsBrowseDomains|kDNSServiceFlagsRegistrationDomains; + [self searchForDomain: flags]; +} + +/** + * Search for all browsable domains. + * + * + */ + +- (void) searchForBrowsableDomains +{ + INTERNALTRACE; + + [self searchForDomain: kDNSServiceFlagsBrowseDomains]; +} + +/** + * Search for all registration domains. These domains can be used to register + * a service. + * + */ + +- (void) searchForRegistrationDomains +{ + INTERNALTRACE; + + [self searchForDomain: kDNSServiceFlagsRegistrationDomains]; +} + +/** + * Search for a particular service within a given domain. + * + * + */ + +- (void) searchForServicesOfType: (NSString *) serviceType + inDomain: (NSString *) domainName +{ + Browser *browser; + DNSServiceErrorType err = kDNSServiceErr_NoError; + DNSServiceFlags flags = 0; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + do + { + if (! _delegate) + { + err = NSNetServicesInvalidError; + break; + } + + if (browser->timer) + { + err = NSNetServicesActivityInProgress; + break; + } + + err = DNSServiceBrowse((DNSServiceRef *) &_netServiceBrowser, + flags, + browser->interfaceIndex, + [serviceType UTF8String], + [domainName UTF8String], + BrowserCallback, + self); + } + while(0); + } + UNLOCK(browser); + + [self executeWithError: err]; +} + +/** + * Halts all currently running searches. + * + * + */ + +- (void) stop +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + + LOCK(browser); + { + [self cleanup]; + + [self netServiceBrowserDidStopSearch: self]; + } + UNLOCK(browser); +} + +/** + * Returns the receiver's delegate. + * + * + */ + +- (id) delegate +{ + INTERNALTRACE; + + return [[_delegate retain] autorelease]; +} + +/** + * Sets the receiver's delegate. + * + * + */ + +- (void) setDelegate: (id) delegate +{ + INTERNALTRACE; + + ASSIGN(_delegate, delegate); +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowserWillSearch: (NSNetServiceBrowser *) aBrowser +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netServiceBrowserWillSearch:)]) + { + [_delegate netServiceBrowserWillSearch: aBrowser]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aBrowser + didNotSearch: (NSDictionary *) errorDict +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netServiceBrowser:didNotSearch:)]) + { + [_delegate netServiceBrowser: aBrowser + didNotSearch: errorDict]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowserDidStopSearch: (NSNetServiceBrowser *) aBrowser +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netServiceBrowserDidStopSearch:)]) + { + [_delegate netServiceBrowserDidStopSearch: aBrowser]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aBrowser + didFindDomain: (NSString *) domainString + moreComing: (BOOL) moreComing +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netServiceBrowser:didFindDomain:moreComing:)]) + { + [_delegate netServiceBrowser: aBrowser + didFindDomain: domainString + moreComing: moreComing]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aBrowser + didRemoveDomain: (NSString *) domainString + moreComing: (BOOL) moreComing +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netServiceBrowser:didRemoveDomain:moreComing:)]) + { + [_delegate netServiceBrowser: aBrowser + didRemoveDomain: domainString + moreComing: moreComing]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aBrowser + didFindService: (NSNetService *) aService + moreComing: (BOOL) moreComing +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netServiceBrowser:didFindService:moreComing:)]) + { + [_delegate netServiceBrowser: aBrowser + didFindService: aService + moreComing: moreComing]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceBrowser: (NSNetServiceBrowser *) aBrowser + didRemoveService: (NSNetService *) aService + moreComing: (BOOL) moreComing +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netServiceBrowser:didRemoveService:moreComing:)]) + { + [_delegate netServiceBrowser: aBrowser + didRemoveService: aService + moreComing: moreComing]; + } +} + +/** + * Initializes the receiver. + * + * + */ + +- (id) init +{ + INTERNALTRACE; + + if ((self = [super init])) + { + Browser *browser; + + browser = malloc(sizeof (struct _Browser)); + memset(browser, 0, sizeof browser); + + CREATELOCK(browser); + + browser->runloop = nil; + browser->runloopmode = nil; + browser->timer = nil; + + browser->services = [[NSMutableDictionary alloc] initWithCapacity: 1]; + + browser->interfaceIndex = 0; + + _netServiceBrowser = NULL; + _delegate = nil; + _reserved = browser; + } + return self; +} + +/** + * Description forthcoming + * + * + */ + +- (void) dealloc +{ + Browser *browser; + + INTERNALTRACE; + + browser = (Browser *) _reserved; + { + LOCK(browser); + { + [self cleanup]; + + DESTROY(browser->services); + + _delegate = nil; + } + UNLOCK(browser); + + DESTROYLOCK(browser); + + free(browser); + } + [super dealloc]; +} + +@end + +@implementation NSNetService + +/** + * Description forthcoming + * + * + */ + ++ (void) initialize +{ + INTERNALTRACE; + + SETVERSION(NSNetService); + { +#ifndef _REENTRANT + LOG(@"%@ may NOT be thread-safe!", [self class]); +#endif + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) executeWithError: (DNSServiceErrorType) err +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + if (kDNSServiceErr_NoError == err) + { + if (YES == service->isPublishing) + { + [self netServiceWillPublish: self]; + } + else + { + [self netServiceWillResolve: self]; + } + + if (! service->runloop) + { + [self scheduleInRunLoop: [NSRunLoop currentRunLoop] + forMode: NSDefaultRunLoopMode]; + } + + [service->runloop addTimer: service->timer + forMode: service->runloopmode]; + + [service->timer fire]; + } + else // notify the delegate of the error + { + if (YES == service->isPublishing) + { + [self netService: self + didNotPublish: CreateError(self, err)]; + } + else + { + [self netService: self + didNotResolve: CreateError(self, err)]; + } + } + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (void) cleanup +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + if (service->runloop) + { + [self removeFromRunLoop: service->runloop + forMode: service->runloopmode]; + } + + if (service->timer) + { + [service->timer invalidate]; + DESTROY(service->timer); + } + + if (_netService) + { + DNSServiceRefDeallocate(_netService); + _netService = NULL; + } + + [service->info removeAllObjects]; + [service->foundAddresses removeAllObjects]; + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (void) stopResolving: (id) sender +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + [service->timeout invalidate]; + [service->timer invalidate]; + + [self netService: self + didNotResolve: CreateError(self, NSNetServicesTimeoutError)]; + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (void) resolverCallback: (DNSServiceRef) sdRef + flags: (DNSServiceFlags) flags + interface: (uint32_t) interfaceIndex + error: (DNSServiceErrorType) errorCode + fullname: (const char *) fullname + target: (const char *) hosttarget + port: (uint16_t) port + length: (uint16_t) txtLen + record: (const char *) txtRecord +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + + if (_netService) + { + if (errorCode) + { + [self cleanup]; + + [self netService: self + didNotResolve: CreateError(self, errorCode)]; + } + else + { + NSData *txt = nil; + NSString *target = nil; + + // Add the TXT record + txt = txtRecord + ? [[NSData alloc] initWithBytes: txtRecord length: txtLen] + : nil; + + // Get the host + target = hosttarget + ? [[NSString alloc] initWithUTF8String: hosttarget] + : nil; + + // Add the port + service->port = ntohs(port); + + // Remove the old TXT entry + [service->info removeObjectForKey: @"TXT"]; + + if (txt) + { + [service->info setObject: txt forKey: @"TXT"]; + [txt release]; + } + + // Remove the old host entry + [service->info removeObjectForKey: @"Host"]; + + // Add the host if there is one + if (target) + { + [service->info setObject: target forKey: @"Host"]; + [target release]; + } + + /* Add the interface so all subsequent + * queries are on the same interface + */ + service->interfaceIndex = interfaceIndex; + + service->timer = nil; + + // Prepare query for A and/or AAAA record + errorCode = DNSServiceQueryRecord((DNSServiceRef *) &_netService, + flags, + interfaceIndex, + hosttarget, + kDNSServiceType_ANY, + kDNSServiceClass_IN, + QueryCallback, + self); + + // No error? Then create a new timer + if (kDNSServiceErr_NoError == errorCode) + { + service->timer = [NSTimer timerWithTimeInterval: INTERVAL + target: self + selector: @selector(loop:) + userInfo: nil + repeats: YES]; + [service->timer fire]; + } + } + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (BOOL) addAddress: (char *) addressString +{ + Service *service; + NSString *string; + + INTERNALTRACE; + + service = (Service *) _reserved; + + if (nil == service->foundAddresses) + { + service->foundAddresses = [[NSMutableArray alloc] init]; + } + + string = [NSString stringWithCString: addressString]; + if ([service->foundAddresses containsObject: string]) + { + // duplicate, didn't add it + return NO; + } + + [service->foundAddresses addObject: string]; + + return YES; +} + + +/** + * Description forthcoming + * + * + */ + +- (void) addAddress: (const void *) rdata + length: (uint16_t) rdlen + type: (uint16_t) rrtype + interface: (uint32_t) interfaceIndex +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + NSData *data = nil; + NSMutableArray *addresses = nil; + struct sockaddr *address = { 0 }; + size_t length = 0; + const unsigned char *rd = rdata; + char rdb[INET6_ADDRSTRLEN]; + + memset(rdb, 0, sizeof rdb); + + addresses = [service->info objectForKey: @"Addresses"]; + + if (nil == addresses) + { + addresses = [[NSMutableArray alloc] initWithCapacity: 1]; + } + + switch(rrtype) + { + case kDNSServiceType_A: // AF_INET + { + struct sockaddr_in ip4; + + // oogly + sprintf(rdb, "%d.%d.%d.%d", rd[0], rd[1], rd[2], rd[3]); + LOG(@"Found IPv4 <%s> on port %d", rdb, service->port); + + length = sizeof (struct sockaddr_in); + memset(&ip4, 0, length); + + inet_pton(AF_INET, rdb, &ip4.sin_addr); + ip4.sin_family = AF_INET; + ip4.sin_port = htons(service->port); + + address = (struct sockaddr *) &ip4; + } + break; + + #if defined(AF_INET6) + case kDNSServiceType_AAAA: // AF_INET6 + case kDNSServiceType_A6: // deprecates AAAA + { + struct sockaddr_in6 ip6; + + // Even more oogly + sprintf(rdb, "%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x:%x%x", + rd[0], rd[1], rd[2], rd[3], + rd[4], rd[5], rd[6], rd[7], + rd[8], rd[9], rd[10], rd[11], + rd[12], rd[13], rd[14], rd[15]); + LOG(@"Found IPv6 <%s> on port %d", rdb, service->port); + + length = sizeof (struct sockaddr_in6); + memset(&ip6, 0, length); + + inet_pton(AF_INET6, rdb, &ip6.sin6_addr); +#if defined(HAVE_SA_LEN) + ip6.sin6_len = sizeof ip6; +#endif + ip6.sin6_family = AF_INET6; + ip6.sin6_port = htons(service->port); + ip6.sin6_flowinfo = 0; + ip6.sin6_scope_id = interfaceIndex; + + address = (struct sockaddr *) &ip6; + } + break; +#endif /* AF_INET6 */ + + default: + LOG(@"Unkown type of length <%d>", rdlen); + break; + } + + // check for duplicate entries + if ([self addAddress: rdb]) + { + // add it + data = [NSData dataWithBytes: address + length: length]; + + [addresses addObject: data]; + [service->info setObject: [addresses retain] + forKey: @"Addresses"]; + + // notify the delegate + [self netServiceDidResolveAddress: self]; + + [addresses release]; + + // got it, so invalidate the timeout + [service->timeout invalidate]; + service->timeout = nil; + } + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (void) queryCallback: (DNSServiceRef) sdRef + flags: (DNSServiceFlags) flags + interface: (uint32_t) interfaceIndex + error: (DNSServiceErrorType) errorCode + fullname: (const char *) fullname + type: (uint16_t) rrtype + class: (uint16_t) rrclass + length: (uint16_t) rdlen + data: (const void *) rdata + ttl: (uint32_t) ttl +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + + if (_netService) + { + if (errorCode) + { + [self cleanup]; + + [self netService: self + didNotResolve: CreateError(self, errorCode)]; + + UNLOCK(service); + + return; + } + + switch(rrtype) + { + case kDNSServiceType_A: // 1 -- AF_INET + [self addAddress: rdata + length: rdlen + type: rrtype + interface: interfaceIndex]; + break; + + case kDNSServiceType_NS: + case kDNSServiceType_MD: + case kDNSServiceType_MF: + case kDNSServiceType_CNAME: // 5 + case kDNSServiceType_SOA: + case kDNSServiceType_MB: + case kDNSServiceType_MG: + case kDNSServiceType_MR: + case kDNSServiceType_NULL: // 10 + case kDNSServiceType_WKS: + case kDNSServiceType_PTR: + case kDNSServiceType_HINFO: + case kDNSServiceType_MINFO: + case kDNSServiceType_MX: // 15 + // not handled (yet) + break; + + case kDNSServiceType_TXT: + { + NSData + *data = nil; + + data = [NSData dataWithBytes: rdata + length: rdlen]; + + [service->info removeObjectForKey: @"TXT"]; + [service->info setObject: data + forKey: @"TXT"]; + + [self netService: self + didUpdateTXTRecordData: data]; + + } + break; + + case kDNSServiceType_RP: + case kDNSServiceType_AFSDB: + case kDNSServiceType_X25: + case kDNSServiceType_ISDN: // 20 + case kDNSServiceType_RT: + case kDNSServiceType_NSAP: + case kDNSServiceType_NSAP_PTR: + case kDNSServiceType_SIG: + case kDNSServiceType_KEY: // 25 + case kDNSServiceType_PX: + case kDNSServiceType_GPOS: + // not handled (yet) + break; + + case kDNSServiceType_AAAA: // 28 -- AF_INET6 + [self addAddress: rdata + length: rdlen + type: rrtype + interface: interfaceIndex]; + break; + + case kDNSServiceType_LOC: + case kDNSServiceType_NXT: // 30 + case kDNSServiceType_EID: + case kDNSServiceType_NIMLOC: + case kDNSServiceType_SRV: + case kDNSServiceType_ATMA: + case kDNSServiceType_NAPTR: // 35 + case kDNSServiceType_KX: + case kDNSServiceType_CERT: + // not handled (yet) + break; + + case kDNSServiceType_A6: // 38 -- AF_INET6, deprecates AAAA + [self addAddress: rdata + length: rdlen + type: rrtype + interface: interfaceIndex]; + break; + + case kDNSServiceType_DNAME: + case kDNSServiceType_SINK: // 40 + case kDNSServiceType_OPT: + // not handled (yet) + break; + + case kDNSServiceType_TKEY: // 249 + case kDNSServiceType_TSIG: // 250 + case kDNSServiceType_IXFR: + case kDNSServiceType_AXFR: + case kDNSServiceType_MAILB: + case kDNSServiceType_MAILA: + // not handled (yet) + break; + + case kDNSServiceType_ANY: + LOG(@"Oops, got the wildcard match..."); + break; + + default: + LOG(@"Don't know how to handle rrtype <%d>", rrtype); + break; + } + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (void) registerCallback: (DNSServiceRef) sdRef + flags: (DNSServiceFlags) flags + error: (DNSServiceErrorType) errorCode + name: (const char *) name + type: (const char *) regtype + domain: (const char *) domain +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + + if (_netService) + { + if (errorCode) + { + [self cleanup]; + + [self netService: self + didNotPublish: CreateError(self, errorCode)]; + } + else + { + [self netServiceDidPublish: self]; + } + } + UNLOCK(service); +} + +/** + * Description forthcoming + * + * + */ + +- (void) loop: (id) sender +{ + int sock = 0; + struct timeval tout = { 0 }; + fd_set set; + DNSServiceErrorType err = kDNSServiceErr_NoError; + + sock = DNSServiceRefSockFD(_netService); + + if (-1 != sock) + { + FD_ZERO(&set); + FD_SET(sock, &set); + + if (1 == select(sock + 1, &set, (fd_set *) NULL, (fd_set *) NULL, &tout)) + { + err = DNSServiceProcessResult(_netService); + } + } + + if (kDNSServiceErr_NoError != err) + { + Service *service; + + service = (Service *) _reserved; + + if (YES == service->isPublishing) + { + [self netService: self + didNotPublish: CreateError(self, err)]; + } + else + { + [self netService: self + didNotResolve: CreateError(self, err)]; + } + } +} + +/** + * Converts txtDictionary into a TXT data. + * + * + */ + ++ (NSData *) dataFromTXTRecordDictionary: (NSDictionary *) txtDictionary +{ + NSMutableData *result = nil; + NSArray *keys = nil; + NSArray *values = nil; + int count = 0; + + INTERNALTRACE; + + count = [txtDictionary count]; + + if (count) + { + keys = [txtDictionary allKeys]; + values = [txtDictionary allValues]; + + if (keys && values) + { + TXTRecordRef txt; + int i = 0; + char key[256]; + + TXTRecordCreate(&txt, 0, NULL); + + for(; i < count; i++) + { + int length = 0; + int used = 0; + DNSServiceErrorType err = kDNSServiceErr_Unknown; + + if (! [[keys objectAtIndex: i] isKindOfClass: [NSString class]]) + { + LOG(@"%@ is not a string", [keys objectAtIndex: i]); + break; + } + + length = [[keys objectAtIndex: i] length]; + [[keys objectAtIndex: i] getCString: key + maxLength: sizeof key]; + used = strlen(key); + + if (! length || (used >= sizeof key)) + { + LOG(@"incorrect length %d - %d - %d", + length, used, sizeof key); + break; + } + + strcat(key, "\0"); + + if ([[values objectAtIndex: i] isKindOfClass: [NSString class]]) + { + char value[256]; + + length = [[values objectAtIndex: i] length]; + [[values objectAtIndex: i] getCString: value + maxLength: sizeof value]; + used = strlen(value); + + if (used >= sizeof value) + { + LOG(@"incorrect length %d - %d - %d", + length, used, sizeof value); + break; + } + + err = TXTRecordSetValue(&txt, + (const char *) key, + used, + value); + } + else if ([[values objectAtIndex: i] isKindOfClass: [NSData class]] + && [[values objectAtIndex: i] length] < 256 + && [[values objectAtIndex: i] length] >= 0) + { + err = TXTRecordSetValue(&txt, + (const char *) key, + [[values objectAtIndex: i] length], + [[values objectAtIndex: i] bytes]); + } + else if ([values objectAtIndex: i] == [NSNull null]) + { + err = TXTRecordSetValue(&txt, + (const char *) key, + 0, + NULL); + } + else + { + LOG(@"unknown value type"); + break; + } + + if (err != kDNSServiceErr_NoError) + { + LOG(@"error creating data type"); + break; + } + } + + if (i == count) + { + result = [NSData dataWithBytes: TXTRecordGetBytesPtr(&txt) + length: TXTRecordGetLength(&txt)]; + } + + TXTRecordDeallocate(&txt); + } + else + { + LOG(@"No keys or values"); + } + + // both are autorelease'd + keys = nil; + values = nil; + } + else + { + LOG(@"Dictionary seems empty"); + } + return result; +} + +/** + * Converts the TXT data txtData into a dictionary. + * + * + */ + ++ (NSDictionary *) dictionaryFromTXTRecordData: (NSData *) txtData +{ + NSMutableDictionary *result = nil; + int len = 0; + const void *txt = 0; + + INTERNALTRACE; + + len = [txtData length]; + txt = [txtData bytes]; + + // + // A TXT record cannot exceed 65535 bytes, see Chapter 6.1 of + // http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt + // + if ((len > 0) && (len < 65536)) + { + uint16_t i = 0; + uint16_t count = 0; + + // get number of keys + count = TXTRecordGetCount(len, txt); + result = [NSMutableDictionary dictionaryWithCapacity: 1]; + + if (result) + { + // go through all keys + for(; i < count; i++) + { + char key[256]; + uint8_t valLen = 0; + const void *value = NULL; + DNSServiceErrorType err = kDNSServiceErr_NoError; + + err = TXTRecordGetItemAtIndex(len, txt, i, + sizeof key, key, + &valLen, &value); + + // only if we can get the key and value... + if (kDNSServiceErr_NoError == err) + { + NSData *data = nil; + NSString *str = nil; + + str = [NSString stringWithUTF8String: key]; + + if (value) + { + data = [NSData dataWithBytes: value + length: valLen]; + } + + if (data && str && [str length] + && ! [result objectForKey: str]) + { + /* only add if key and value were created + * and key doesn't exist yet + */ + [result setValue: data + forKey: str]; + } + else + { + /* I'm not exactly sure what to do if there + * is a key WITHOUT a value + * Theoretically '<6>foobar' should be identical + * to '<7>foobar=' i.e. the value would be [NSNull null] + */ + [result setValue: [NSNull null] + forKey: str]; + } + + // both are autorelease'd + data = nil; + str = nil; + } + else + { + LOG(@"Couldn't get TXTRecord item"); + } + } + } + else + { + LOG(@"Couldn't create dictionary"); + } + } + else + { + LOG(@"TXT record has incorrect length: <%d>", len); + } + return result; +} + +/** + * Initializes the receiver for service resolution. Use this method to create + * an object if you intend to -resolve a service. + * + */ + +- (id) initWithDomain: (NSString *) domain + type: (NSString *) type + name: (NSString *) name +{ + INTERNALTRACE; + + return [self initWithDomain: domain + type: type + name: name + port: -1]; // -1 to indicate resolution, not publish +} + +/** + * Initializes the receiver for service publication. Use this method to create + * an object if you intend to -publish a service. + * + */ + +- (id) initWithDomain: (NSString *) domain + type: (NSString *) type + name: (NSString *) name + port: (int) port +{ + INTERNALTRACE; + + if ((self = [super init])) + { + Service *service; + + service = malloc(sizeof (struct _Service)); + memset(service, 0, sizeof service); + + CREATELOCK(service); + + service->runloop = nil; + service->runloopmode = nil; + service->timer = nil; + service->timeout = nil; + + service->info = [[NSMutableDictionary alloc] initWithCapacity: 1]; + [service->info setObject: [domain retain] + forKey: @"Domain"]; + [service->info setObject: [name retain] + forKey: @"Name"]; + [service->info setObject: [type retain] + forKey: @"Type"]; + + service->foundAddresses = nil; + + service->interfaceIndex = 0; + service->port = htons(port); + + service->monitor = nil; + + service->isPublishing = (-1 == port) ? NO : YES; + service->isMonitoring = NO; + + _netService = NULL; + _delegate = nil; + _reserved = service; + + return self; + } + + return nil; +} + +/** + * Removes the service from the specified run loop. + * + * + */ + +- (void) removeFromRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + if (service->timer) + { + [service->timer setFireDate: [NSDate date]]; + [service->timer invalidate]; + + // Do not release the timer! + service->timer = nil; + } + + // Do not release the runloop! + service->runloop = nil; + + DESTROY(service->runloopmode); + } + UNLOCK(service); +} + +/** + * Adds the service to the specified run loop. + * + * + */ + +- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + if (service->timer) + { + [service->timer setFireDate: [NSDate date]]; + [service->timer invalidate]; + service->timer = nil; + } + + service->timer = [NSTimer timerWithTimeInterval: INTERVAL + target: self + selector: @selector(loop:) + userInfo: nil + repeats: YES]; + + service->runloop = aRunLoop; + service->runloopmode = mode; + + [service->timer retain]; + } + UNLOCK(service); +} + +/** + * Attempts to publish a service on the network. + * + * + */ + +- (void) publish +{ + Service *service; + DNSServiceErrorType err = kDNSServiceErr_NoError; + DNSServiceFlags flags = 0; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + do + { + // cannot -publish on a service that's init'd for resolving + if (NO == service->isPublishing) + { + err = NSNetServicesBadArgumentError; + break; + } + + if (! _delegate) + { + err = NSNetServicesInvalidError; + break; + } + + if (service->timer) + { + err = NSNetServicesActivityInProgress; + break; + } + + if (service->timeout) + { + [service->timeout setFireDate: [NSDate date]]; + [service->timeout invalidate]; + service->timeout = nil; + } + + err = DNSServiceRegister((DNSServiceRef *) &_netService, + flags, service->interfaceIndex, + [[service->info objectForKey: @"Name"] UTF8String], + [[service->info objectForKey: @"Type"] UTF8String], + [[service->info objectForKey: @"Domain"] UTF8String], + NULL, service->port, 0, NULL, + RegistrationCallback, self); + } + while(0); + } + UNLOCK(service); + + [self executeWithError: err]; +} + +/** + * This method is deprecated. Use -resolveWithTimeout: instead. + * + * + */ + +- (void) resolve +{ + INTERNALTRACE; + + [self resolveWithTimeout: 5]; +} + +/** + * Starts a service resolution for a limited duration. + * + * + */ + +- (void) resolveWithTimeout: (NSTimeInterval) timeout +{ + Service *service; + DNSServiceErrorType err = kDNSServiceErr_NoError; + DNSServiceFlags flags = 0; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + do + { + // cannot -resolve on a service that's init'd for publishing + if (YES == service->isPublishing) + { + err = NSNetServicesBadArgumentError; + break; + } + + if (! _delegate) + { + err = NSNetServicesInvalidError; + break; + } + + if (service->timer) + { + err = NSNetServicesActivityInProgress; + break; + } + + if (service->timeout) + { + [service->timeout setFireDate: [NSDate date]]; + [service->timeout invalidate]; + service->timeout = nil; + } + + service->timeout = [NSTimer alloc]; + { + NSDate *date = nil; + + date = [NSDate dateWithTimeIntervalSinceNow: timeout + SHORTTIMEOUT]; + + [service->timeout initWithFireDate: date + interval: INTERVAL + target: self + selector: @selector(stopResolving:) + userInfo: nil + repeats: NO]; + } + + err = DNSServiceResolve((DNSServiceRef *) &_netService, + flags, + service->interfaceIndex, + [[service->info objectForKey: @"Name"] UTF8String], + [[service->info objectForKey: @"Type"] UTF8String], + [[service->info objectForKey: @"Domain"] UTF8String], + ResolverCallback, + self); + } + while(0); + } + UNLOCK(service); + + [self executeWithError: err]; +} + +/** + * Stops the current attempt to publish or resolve a service. + * + * + */ + +- (void) stop +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + [self cleanup]; + + [self netServiceDidStop: self]; + } + UNLOCK(service); +} + +/** + * Starts monitoring of TXT record updates. + * + * + */ + +- (void) startMonitoring +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + // Obviously this will only work on a resolver + if (! service->isPublishing) + { + if (! service->isMonitoring) + { + service->monitor + = [[NSNetServiceMonitor alloc] initWithDelegate: self]; + + [service->monitor scheduleInRunLoop: service->runloop + forMode: service->runloopmode]; + [service->monitor start]; + + service->isMonitoring = YES; + } + } + } + UNLOCK(service); +} + +/** + * Stops monitoring of TXT record updates. + * + * + */ + +- (void) stopMonitoring +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + if (! service->isPublishing) + { + if (service->isMonitoring) + { + [service->monitor stop]; + + // Probably don't need it anymore, so release it + DESTROY(service->monitor); + service->isMonitoring = NO; + } + } + } + UNLOCK(service); +} + +/** + * Returns the receiver's delegate. + * + * + */ + +- (id) delegate +{ + INTERNALTRACE; + + return [[_delegate retain] autorelease]; +} + +/** + * Sets the receiver's delegate. + * + * + */ + +- (void) setDelegate: (id) delegate +{ + INTERNALTRACE; + + ASSIGN(_delegate, delegate); +} + +/** + * Returns an array of NSData objects that each contain the socket address of + * the service. + * + */ + +- (NSArray *) addresses +{ + INTERNALTRACE; + + return [((Service*)_reserved)->info objectForKey: @"Addresses"]; +} + +/** + * Returns the domain name of the service. + * + * + */ + +- (NSString *) domain +{ + INTERNALTRACE; + + return [((Service*)_reserved)->info objectForKey: @"Domain"]; +} + +/** + * Returns the host name of the computer publishing the service. + * + * + */ + +- (NSString *) hostName +{ + INTERNALTRACE; + + return [((Service*)_reserved)->info objectForKey: @"Host"]; +} + +/** + * Returns the name of the service. + * + * + */ + +- (NSString *) name +{ + INTERNALTRACE; + + return [((Service*)_reserved)->info objectForKey: @"Name"]; +} + +/** + * Returns the type of the service. + * + * + */ + +- (NSString *) type +{ + INTERNALTRACE; + + return [((Service*)_reserved)->info objectForKey: @"Type"]; +} + +/** + * This method is deprecated. Use -TXTRecordData instead. + * + * + */ + +- (NSString *) protocolSpecificInformation +{ + NSMutableArray *array = nil; + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + // + // I must admit, the following may not be entirely correct... + // + LOCK(service); + { + NSDictionary *dictionary = nil; + + dictionary = [NSNetService dictionaryFromTXTRecordData: + [self TXTRecordData]]; + + if (dictionary) + { + NSEnumerator *keys = nil; + NSString *key = nil; + + array = [NSMutableArray arrayWithCapacity: [dictionary count]]; + keys = [dictionary keyEnumerator]; + + while((key = [keys nextObject])) + { + NSData *value = nil; + + value = [dictionary objectForKey: key]; + + if (value != (NSData *) [NSNull null]) + { + NSData *str; + NSString *pair; + + // FIXME ... should this be UTF8? + str = [[NSString alloc] + initWithBytes: [value bytes] + length: [value length] + encoding: NSUTF8StringEncoding]; + pair = [NSString stringWithFormat: @"%@=%@", key, str]; + RELEASE(str); + + [array addObject: pair]; + } + else if ([key length]) + { + [array addObject: [NSString stringWithFormat: @"%@", key]]; + } + } + } + } + UNLOCK(service); + + return ([array count] ? [array componentsJoinedByString: @"\001"] + : (NSString *) nil); +} + +/** + * This method is deprecated. Use -setTXTRecordData: instead. + * + * + */ + +- (void) setProtocolSpecificInformation: (NSString *) specificInformation +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + // + // Again, the following may not be entirely correct... + // + LOCK(service); + { + NSArray *array = nil; + + array = [specificInformation componentsSeparatedByString: @"\001"]; + + if (array) + { + NSMutableDictionary *dictionary = nil; + NSEnumerator *enumerator = nil; + NSString *item = nil; + + dictionary + = [NSMutableDictionary dictionaryWithCapacity: [array count]]; + enumerator = [array objectEnumerator]; + + while((item = [enumerator nextObject])) + { + NSArray *parts = nil; + NSData *value; + + parts = [item componentsSeparatedByString:@"="]; + + value = [[parts objectAtIndex: 1] + dataUsingEncoding: NSUTF8StringEncoding]; + [dictionary setObject: value + forKey: [parts objectAtIndex: 0]]; + } + + [self setTXTRecordData: + [NSNetService dataFromTXTRecordDictionary: dictionary]]; + } + } + UNLOCK(service); +} + +/** + * Returns the TXT record. + * + * + */ + +- (NSData *) TXTRecordData +{ + INTERNALTRACE; + + return [((Service*)_reserved)->info objectForKey: @"TXT"]; +} + +/** + * Sets the TXT record. + * + * + */ + +- (BOOL) setTXTRecordData: (NSData *) recordData +{ + Service *service; + BOOL result = NO; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + // Not allowed on a resolver... + if (service->isPublishing) + { + DNSServiceErrorType + err = kDNSServiceErr_NoError; + + // Set the value, or remove it if empty + if (recordData) + { + [service->info setObject: recordData + forKey: @"TXT"]; + } + else + { + [service->info removeObjectForKey: @"TXT"]; + } + + // Assume it worked + result = YES; + + // Now update the record so others can pick it up + err = DNSServiceUpdateRecord(_netService, + NULL, + 0, + recordData ? [recordData length] : 0, + recordData ? [recordData bytes] : NULL, + 0); + if (err) + { + result = NO; + } + } + } + UNLOCK(service); + + return result; +} + +/** + * Retrieves the input and output stream for the receiver. + * + * + */ + +- (BOOL) getInputStream: (NSInputStream **) inputStream + outputStream: (NSOutputStream **) outputStream +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + + LOCK(service); + { + [NSStream getStreamsToHost: [service->info objectForKey: @"Host"] + port: ntohs(service->port) + inputStream: inputStream + outputStream: outputStream]; + } + UNLOCK(service); + + return inputStream && outputStream; +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceWillPublish: (NSNetService *) sender +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netServiceWillPublish:)]) + { + [_delegate netServiceWillPublish: sender]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceDidPublish: (NSNetService *) sender +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netServiceDidPublish:)]) + { + [_delegate netServiceDidPublish: sender]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netService: (NSNetService *) sender + didNotPublish: (NSDictionary *) errorDict +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netService:didNotPublish:)]) + { + [_delegate netService: sender + didNotPublish: errorDict]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceWillResolve: (NSNetService *) sender +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netServiceWillResolve:)]) + { + [_delegate netServiceWillResolve: sender]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceDidResolveAddress: (NSNetService *) sender +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netServiceDidResolveAddress:)]) + { + [_delegate netServiceDidResolveAddress: sender]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netService: (NSNetService *) sender + didNotResolve: (NSDictionary *) errorDict +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netService:didNotResolve:)]) + { + [_delegate netService: sender + didNotResolve: errorDict]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netServiceDidStop: (NSNetService *) sender +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: @selector(netServiceDidStop:)]) + { + [_delegate netServiceDidStop: sender]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netService: (NSNetService *) sender + didUpdateTXTRecordData: (NSData *) data +{ + INTERNALTRACE; + + if ([_delegate respondsToSelector: + @selector(netService:didUpdateTXTRecordData:)]) + { + [_delegate netService: sender + didUpdateTXTRecordData: data]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) netService: (NSNetService *) sender + didNotMonitor: (NSDictionary *) errorDict +{ + INTERNALTRACE; + + // This method is kind of a misnomer. It's called whenever NSNetMonitor + // encounters an error while monitoring. + // All we do is stop monitoring -- which we COULD do from NSNetMonitor + // directly, but this seems to be much cleaner. + + [self stopMonitoring]; +} + +/** + * Description forthcoming + * + * + */ + +- (id) init +{ + DESTROY(self); + return self; +} + +/** + * Description forthcoming + * + * + */ + +- (void) dealloc +{ + Service *service; + + INTERNALTRACE; + + service = (Service *) _reserved; + { + LOCK(service); + { + [self stopMonitoring]; + [self cleanup]; + + DESTROY(service->info); + DESTROY(service->foundAddresses); + DESTROY(_delegate); + } + UNLOCK(service); + + DESTROYLOCK(service); + + free(service); + } + [super dealloc]; +} + +@end + +@implementation NSNetServiceMonitor + +/** + * Description forthcoming + * + * + */ + ++ (void) initialize +{ + INTERNALTRACE; + + SETVERSION(NSNetServiceMonitor); +} + +/** + * Description forthcoming + * + * + */ + +- (void) loop: (id) sender +{ + int sock = 0; + struct timeval tout = { 0 }; + fd_set set; + DNSServiceErrorType err = kDNSServiceErr_NoError; + + sock = DNSServiceRefSockFD(_netServiceMonitor); + + if (-1 != sock) + { + FD_ZERO(&set); + FD_SET(sock, &set); + + if (1 == select(sock + 1, &set, (fd_set *) NULL, (fd_set *) NULL, &tout)) + { + err = DNSServiceProcessResult(_netServiceMonitor); + } + } + + if (kDNSServiceErr_NoError != err) + { + LOG(@"Error <%d> while monitoring", err); + + [_delegate netService: _delegate + didNotMonitor: CreateError(self, err)]; + } +} + +/** + * Description forthcoming + * + * + */ + +- (void) queryCallback: (DNSServiceRef) sdRef + flags: (DNSServiceFlags) flags + interface: (uint32_t) interfaceIndex + error: (DNSServiceErrorType) errorCode + fullname: (const char *) fullname + type: (uint16_t) rrtype + class: (uint16_t) rrclass + length: (uint16_t) rdlen + data: (const void *) rdata + ttl: (uint32_t) ttl +{ + Monitor *monitor; + + INTERNALTRACE; + + monitor = (Monitor *) _reserved; + + LOCK(monitor); + + if (_delegate) + { + // we are 'monitoring' kDNSServiceType_TXT + // this is already handled by the delegate's method of the same name + // so we simply pass this through + [_delegate queryCallback: sdRef + flags: flags + interface: interfaceIndex + error: errorCode + fullname: fullname + type: rrtype + class: rrclass + length: rdlen + data: rdata + ttl: ttl]; + } + UNLOCK(monitor); +} + +/** + * Description forthcoming + * + * + */ + +- (id) initWithDelegate: (id) delegate +{ + INTERNALTRACE; + + if ((self = [super init]) != nil) + { + Monitor *monitor; + + monitor = malloc(sizeof (struct _Monitor)); + memset(monitor, 0, sizeof monitor); + + CREATELOCK(monitor); + + monitor->runloop = nil; + monitor->runloopmode = nil; + monitor->timer = nil; + + _netServiceMonitor = NULL; + _delegate = [delegate retain]; + _reserved = monitor; + } + return self; +} + +/** + * Description forthcoming + * + * + */ + +- (void) removeFromRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode +{ + Monitor *monitor; + + INTERNALTRACE; + + monitor = (Monitor *) _reserved; + + LOCK(monitor); + { + if (monitor->timer) + { + [monitor->timer setFireDate: [NSDate date]]; + [monitor->timer invalidate]; + monitor->timer = nil; + } + + // Do not release the runloop! + monitor->runloop = nil; + + // [monitor->runloopmode release]; + monitor->runloopmode = nil; + } + UNLOCK(monitor); +} + +/** + * Description forthcoming + * + * + */ + +- (void) scheduleInRunLoop: (NSRunLoop *) aRunLoop + forMode: (NSString *) mode +{ + Monitor *monitor; + + INTERNALTRACE; + + monitor = (Monitor *) _reserved; + + LOCK(monitor); + { + if (monitor->timer) + { + [monitor->timer setFireDate: [NSDate date]]; + [monitor->timer invalidate]; + monitor->timer = nil; + } + + monitor->runloop = aRunLoop; + monitor->runloopmode = mode; + } + UNLOCK(monitor); +} + +/** + * Description forthcoming + * + * + */ + +- (void) start +{ + Monitor *monitor; + + INTERNALTRACE; + + monitor = (Monitor *) _reserved; + + LOCK(monitor); + { + DNSServiceErrorType err = kDNSServiceErr_NoError; + DNSServiceFlags flags = kDNSServiceFlagsLongLivedQuery; + NSString *fullname = nil; + + do + { + if (! _delegate) + { + err = NSNetServicesInvalidError; + break; + } + + if (monitor->timer) + { + err = NSNetServicesActivityInProgress; + break; + } + + fullname = [NSString stringWithFormat: @"%@.%@%@", + [_delegate name], [_delegate type], [_delegate domain]]; + + err = DNSServiceQueryRecord((DNSServiceRef *) &_netServiceMonitor, + flags, + 0, + [fullname UTF8String], + kDNSServiceType_TXT, + kDNSServiceClass_IN, + QueryCallback, + self); + + if (kDNSServiceErr_NoError == err) + { + monitor->timer = [NSTimer timerWithTimeInterval: INTERVAL + target: self + selector: @selector(loop:) + userInfo: nil + repeats: YES]; + + [monitor->runloop addTimer: monitor->timer + forMode: monitor->runloopmode]; + + [monitor->timer fire]; + } + } + while(0); + } + UNLOCK(monitor); +} + +/** + * Description forthcoming + * + * + */ + +- (void) stop +{ + Monitor *monitor; + + INTERNALTRACE; + + monitor = (Monitor *) _reserved; + + LOCK(monitor); + { + if (monitor->runloop) + { + [self removeFromRunLoop: monitor->runloop + forMode: monitor->runloopmode]; + } + + if (monitor->timer) + { + [monitor->timer invalidate]; + monitor->timer = nil; + } + + if (_netServiceMonitor) + { + DNSServiceRefDeallocate(_netServiceMonitor); + _netServiceMonitor = NULL; + } + } + UNLOCK(monitor); +} + +/** + * Description forthcoming + * + * + */ + +- (id) init +{ + DESTROY(self); + return nil; +} + +/** + * Description forthcoming + * + * + */ + +- (void) dealloc +{ + Monitor *monitor; + + INTERNALTRACE; + + monitor = (Monitor *) _reserved; + { + LOCK(monitor); + { + [self stop]; + + _delegate = nil; + } + UNLOCK(monitor); + + DESTROYLOCK(monitor); + + free(monitor); + } + [super dealloc]; +} + +@end + +/** + * Description forthcoming + * + * + */ + +PRIVATE NSDictionary * +CreateError(id sender, int errorCode) +{ + NSMutableDictionary *dictionary = nil; + int error = 0; + + INTERNALTRACE; + + dictionary = [NSMutableDictionary dictionary]; + error = ConvertError(errorCode); + + LOG(@"%@ says error <%d> - <%d>", [sender description], errorCode, error); + + [dictionary setObject: [NSNumber numberWithInt: error] + forKey: NSNetServicesErrorCode]; + [dictionary setObject: sender + forKey: NSNetServicesErrorDomain]; + + return dictionary; // autorelease'd +} + +/** + * Description forthcoming + * + * + */ + +PRIVATE int +ConvertError(int errorCode) +{ + INTERNALTRACE; + + switch(errorCode) + { + case kDNSServiceErr_Unknown: + return NSNetServicesUnknownError; + + case kDNSServiceErr_NoSuchName: + return NSNetServicesNotFoundError; + + case kDNSServiceErr_NoMemory: + return NSNetServicesUnknownError; + + case kDNSServiceErr_BadParam: + case kDNSServiceErr_BadReference: + case kDNSServiceErr_BadState: + case kDNSServiceErr_BadFlags: + return NSNetServicesBadArgumentError; + + case kDNSServiceErr_Unsupported: + return NSNetServicesUnknownError; + + case kDNSServiceErr_NotInitialized: + return NSNetServicesInvalidError; + + case kDNSServiceErr_AlreadyRegistered: + case kDNSServiceErr_NameConflict: + return NSNetServicesCollisionError; + + case kDNSServiceErr_Invalid: + return NSNetServicesInvalidError; + + case kDNSServiceErr_Firewall: + return NSNetServicesUnknownError; + + case kDNSServiceErr_Incompatible: + // The client library is incompatible with the daemon + return NSNetServicesInvalidError; + + case kDNSServiceErr_BadInterfaceIndex: + case kDNSServiceErr_Refused: + return NSNetServicesUnknownError; + + case kDNSServiceErr_NoSuchRecord: + case kDNSServiceErr_NoAuth: + case kDNSServiceErr_NoSuchKey: + return NSNetServicesNotFoundError; + + case kDNSServiceErr_NATTraversal: + case kDNSServiceErr_DoubleNAT: + case kDNSServiceErr_BadTime: + return NSNetServicesUnknownError; + } + + return errorCode; +} + +/** + * Description forthcoming + * + * + */ + +PRIVATE void +EnumerationCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *replyDomain, + void *context) +{ + // NSNetServiceBrowser + [(id) context enumCallback: sdRef + flags: flags + interface: interfaceIndex + error: errorCode + domain: replyDomain]; +} + +/** + * Description forthcoming + * + * + */ + +PRIVATE void +BrowserCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *replyName, + const char *replyType, + const char *replyDomain, + void *context) +{ + // NSNetServiceBrowser + [(id) context browseCallback: sdRef + flags: flags + interface: interfaceIndex + error: errorCode + name: replyName + type: replyType + domain: replyDomain]; +} + +/** + * Description forthcoming + * + * + */ + +PRIVATE void +ResolverCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *fullname, + const char *hosttarget, + uint16_t port, + uint16_t txtLen, + const char *txtRecord, + void *context) +{ + // NSNetService + [(id) context resolverCallback: sdRef + flags: flags + interface: interfaceIndex + error: errorCode + fullname: fullname + target: hosttarget + port: port + length: txtLen + record: txtRecord]; +} + +/** + * Description forthcoming + * + * + */ + +PRIVATE void +RegistrationCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + DNSServiceErrorType errorCode, + const char *name, + const char *regtype, + const char *domain, + void *context) +{ + // NSNetService + [(id) context registerCallback: sdRef + flags: flags + error: errorCode + name: name + type: regtype + domain: domain]; +} + +/** + * Description forthcoming + * + * + */ + +PRIVATE void +QueryCallback(DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char *fullname, + uint16_t rrtype, + uint16_t rrclass, + uint16_t rdlen, + const void *rdata, + uint32_t ttl, + void *context) +{ + // NSNetService, NSNetServiceMonitor + [(id) context queryCallback: sdRef + flags: flags + interface: interfaceIndex + error: errorCode + fullname: fullname + type: rrtype + class: rrclass + length: rdlen + data: rdata + ttl: ttl]; +} + diff --git a/base.make.in b/base.make.in index d75d5b16b..cc35fe54f 100644 --- a/base.make.in +++ b/base.make.in @@ -50,5 +50,6 @@ ifeq ($(FOUNDATION_LIB),gnu) endif GNUSTEP_BASE_HAVE_LIBXML=@HAVE_LIBXML@ + GNUSTEP_BASE_HAVE_MDNS=@HAVE_MDNS@ endif # BASE_MAKE_LOADED diff --git a/configure b/configure index 82b3794ab..42ec4a487 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60. +# Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -10,7 +10,8 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -19,10 +20,13 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + + # PATH needs CR @@ -215,7 +219,7 @@ test \$exitcode = 0) || { (exit 1); exit 1; } else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. @@ -233,7 +237,6 @@ IFS=$as_save_IFS # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF -# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -242,10 +245,12 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + : _ASEOF @@ -253,7 +258,6 @@ _ASEOF CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF -# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -262,10 +266,12 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + : (as_func_return () { @@ -512,19 +518,28 @@ else as_mkdir_p=false fi -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_executable_p=: + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi -rm -f conf$$.file +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -565,36 +580,36 @@ ac_unique_file="Source/NSArray.m" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include #endif -#if HAVE_STDINT_H +#ifdef HAVE_STDINT_H # include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include #endif" @@ -714,6 +729,7 @@ XML_CFLAGS XML_LIBS HAVE_LIBXSLT HAVE_LIBXML +HAVE_MDNS USE_GMP INCLUDE_FLAGS LDIR_FLAGS @@ -732,6 +748,7 @@ target_alias CC CFLAGS LDFLAGS +LIBS CPPFLAGS CPP' ac_subdirs_all='Source/mframe SSL' @@ -839,10 +856,10 @@ do -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) @@ -858,10 +875,10 @@ do -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ @@ -1055,19 +1072,19 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) @@ -1377,6 +1394,7 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor @@ -1445,7 +1463,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.60 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -1459,7 +1477,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2254,7 +2272,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2294,7 +2312,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2351,7 +2369,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2392,7 +2410,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2450,7 +2468,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2494,7 +2512,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2635,7 +2653,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. -for ac_file in $ac_files +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in @@ -2663,6 +2681,12 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2674,8 +2698,6 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -2853,27 +2875,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 @@ -2928,27 +2933,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 @@ -2983,27 +2971,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 @@ -3039,27 +3010,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 @@ -3175,27 +3129,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 @@ -3284,17 +3221,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3328,17 +3258,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3403,17 +3326,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3447,17 +3363,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3510,7 +3419,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_WHOAMI="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3680,7 +3589,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -3762,7 +3671,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -3858,27 +3767,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 @@ -4054,27 +3946,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -4137,27 +4012,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -4193,17 +4051,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -4309,27 +4160,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then sa_len=1 else echo "$as_me: failed program was:" >&5 @@ -4376,27 +4210,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } gs_visibility=1 @@ -4526,7 +4343,8 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif @@ -4547,27 +4365,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4602,27 +4403,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 @@ -4673,27 +4457,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi @@ -4841,27 +4608,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_voidp=yes else echo "$as_me: failed program was:" >&5 @@ -4875,16 +4625,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5 echo "${ECHO_T}$ac_cv_type_voidp" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of void*" >&5 echo $ECHO_N "checking size of void*... $ECHO_C" >&6; } if test "${ac_cv_sizeof_voidp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_voidp" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4894,7 +4643,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void* ac__type_sizeof_; + typedef void* ac__type_sizeof_; int main () { @@ -4918,27 +4667,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4948,7 +4680,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void* ac__type_sizeof_; + typedef void* ac__type_sizeof_; int main () { @@ -4972,27 +4704,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5019,7 +4734,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void* ac__type_sizeof_; + typedef void* ac__type_sizeof_; int main () { @@ -5043,27 +4758,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5073,7 +4771,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void* ac__type_sizeof_; + typedef void* ac__type_sizeof_; int main () { @@ -5097,27 +4795,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5154,7 +4835,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void* ac__type_sizeof_; + typedef void* ac__type_sizeof_; int main () { @@ -5178,27 +4859,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -5211,11 +4875,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_voidp=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*) +'') if test "$ac_cv_type_voidp" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void*) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_voidp=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -5225,7 +4893,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void* ac__type_sizeof_; + typedef void* ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -5284,21 +4952,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void*) +if test "$ac_cv_type_voidp" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void*) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_voidp=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_voidp=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5 echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOIDP $ac_cv_sizeof_voidp _ACEOF @@ -5347,27 +5019,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 @@ -5381,16 +5036,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_short" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5400,7 +5054,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5424,27 +5078,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5454,7 +5091,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5478,27 +5115,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5525,7 +5145,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5549,27 +5169,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5579,7 +5182,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5603,27 +5206,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5660,7 +5246,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5684,27 +5270,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -5717,11 +5286,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) +'') if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -5731,7 +5304,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -5790,21 +5363,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short) +if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_short=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF @@ -5849,27 +5426,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 @@ -5883,16 +5443,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5902,7 +5461,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5926,27 +5485,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5956,7 +5498,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5980,27 +5522,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6027,7 +5552,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -6051,27 +5576,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6081,7 +5589,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -6105,27 +5613,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6162,7 +5653,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -6186,27 +5677,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -6219,11 +5693,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -6233,7 +5711,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -6292,21 +5770,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF @@ -6351,27 +5833,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 @@ -6385,16 +5850,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6404,7 +5868,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6428,27 +5892,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6458,7 +5905,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6482,27 +5929,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6529,7 +5959,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6553,27 +5983,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6583,7 +5996,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6607,27 +6020,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6664,7 +6060,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6688,27 +6084,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -6721,11 +6100,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -6735,7 +6118,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -6794,21 +6177,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -6853,27 +6240,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 @@ -6887,16 +6257,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long_long" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6906,7 +6275,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6930,27 +6299,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6960,7 +6312,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6984,27 +6336,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -7031,7 +6366,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -7055,27 +6390,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7085,7 +6403,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -7109,27 +6427,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -7166,7 +6467,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -7190,27 +6491,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -7223,11 +6507,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +'') if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -7237,7 +6525,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -7296,21 +6584,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long_long=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF @@ -7355,27 +6647,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_float=yes else echo "$as_me: failed program was:" >&5 @@ -7389,16 +6664,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 echo "${ECHO_T}$ac_cv_type_float" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of float" >&5 echo $ECHO_N "checking size of float... $ECHO_C" >&6; } if test "${ac_cv_sizeof_float+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_float" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -7408,7 +6682,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; + typedef float ac__type_sizeof_; int main () { @@ -7432,27 +6706,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7462,7 +6719,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; + typedef float ac__type_sizeof_; int main () { @@ -7486,27 +6743,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -7533,7 +6773,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; + typedef float ac__type_sizeof_; int main () { @@ -7557,27 +6797,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7587,7 +6810,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; + typedef float ac__type_sizeof_; int main () { @@ -7611,27 +6834,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -7668,7 +6874,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; + typedef float ac__type_sizeof_; int main () { @@ -7692,27 +6898,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -7725,11 +6914,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) +'') if test "$ac_cv_type_float" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_float=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -7739,7 +6932,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; + typedef float ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -7798,21 +6991,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (float) +if test "$ac_cv_type_float" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_float=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_float=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF @@ -7857,27 +7054,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_double=yes else echo "$as_me: failed program was:" >&5 @@ -7891,16 +7071,15 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 echo "${ECHO_T}$ac_cv_type_double" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of double" >&5 echo $ECHO_N "checking size of double... $ECHO_C" >&6; } if test "${ac_cv_sizeof_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_double" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -7910,7 +7089,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; + typedef double ac__type_sizeof_; int main () { @@ -7934,27 +7113,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7964,7 +7126,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; + typedef double ac__type_sizeof_; int main () { @@ -7988,27 +7150,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -8035,7 +7180,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; + typedef double ac__type_sizeof_; int main () { @@ -8059,27 +7204,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -8089,7 +7217,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; + typedef double ac__type_sizeof_; int main () { @@ -8113,27 +7241,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -8170,7 +7281,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; + typedef double ac__type_sizeof_; int main () { @@ -8194,27 +7305,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -8227,11 +7321,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) +'') if test "$ac_cv_type_double" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_double=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -8241,7 +7339,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; + typedef double ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -8300,21 +7398,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (double) +if test "$ac_cv_type_double" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_double=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_double=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_DOUBLE $ac_cv_sizeof_double _ACEOF @@ -8638,27 +7740,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -8694,17 +7779,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -8793,27 +7871,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -8849,17 +7910,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -8949,27 +8003,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -9005,17 +8042,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -9105,27 +8135,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -9161,17 +8174,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -9278,27 +8284,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dladdr=yes else echo "$as_me: failed program was:" >&5 @@ -9307,7 +8297,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dladdr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -9638,27 +8628,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -9667,7 +8641,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -9745,27 +8719,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 @@ -9821,27 +8778,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 @@ -9915,27 +8855,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 @@ -10109,27 +9032,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -10165,17 +9071,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -10277,27 +9176,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -10333,17 +9215,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -10450,27 +9325,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -10506,17 +9364,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -10615,27 +9466,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -10671,17 +9505,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -10779,27 +9606,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -10864,27 +9674,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -10920,17 +9713,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -11027,27 +9813,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 @@ -11056,7 +9826,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -11148,27 +9918,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -11177,7 +9931,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -11240,27 +9994,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -11296,17 +10033,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -11434,27 +10164,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -11463,7 +10177,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -11544,27 +10258,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -11600,17 +10297,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -11712,27 +10402,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -11768,17 +10441,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -11880,27 +10546,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_iberty_dyn_string_append=yes else echo "$as_me: failed program was:" >&5 @@ -11909,7 +10559,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iberty_dyn_string_append=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -11967,27 +10617,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_bfd_bfd_openr=yes else echo "$as_me: failed program was:" >&5 @@ -11996,7 +10630,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bfd_bfd_openr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12054,27 +10688,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -12110,17 +10727,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -12246,27 +10856,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -12275,7 +10869,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -12332,27 +10926,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -12388,17 +10965,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -12524,27 +11094,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -12553,7 +11107,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -12642,27 +11196,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -12698,17 +11235,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -12844,27 +11374,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -12873,7 +11387,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13060,27 +11574,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -13089,7 +11587,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13147,27 +11645,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -13240,27 +11721,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 @@ -13269,7 +11734,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break @@ -13340,27 +11805,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 @@ -13369,7 +11818,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break @@ -13436,27 +11885,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -13492,17 +11924,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -13632,27 +12057,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -13661,7 +12070,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13746,27 +12155,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -13775,7 +12168,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13860,27 +12253,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -13889,7 +12266,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -13970,27 +12347,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -13999,7 +12360,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14080,27 +12441,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -14109,7 +12454,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14196,27 +12541,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -14225,7 +12554,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14380,27 +12709,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -14436,17 +12748,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -14625,27 +12930,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -14654,7 +12943,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -14708,27 +12997,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -14764,17 +13036,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -14876,27 +13141,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_z_gzseek=yes else echo "$as_me: failed program was:" >&5 @@ -14905,7 +13154,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_gzseek=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -15001,27 +13250,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -15030,7 +13263,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -15115,27 +13348,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -15144,7 +13361,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -15199,27 +13416,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_uintmax_t=yes else echo "$as_me: failed program was:" >&5 @@ -15279,17 +13479,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then llmax=yes else echo "$as_me: failed program was:" >&5 @@ -15345,17 +13538,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then llmax=yes else echo "$as_me: failed program was:" >&5 @@ -15417,27 +13603,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -15473,17 +13642,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -15671,27 +13833,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_register_printf_function=yes else echo "$as_me: failed program was:" >&5 @@ -15700,7 +13846,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_register_printf_function=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_register_printf_function" >&5 @@ -15835,27 +13981,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -15864,7 +13994,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -15997,27 +14127,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -16053,17 +14166,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -16166,27 +14272,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -16222,17 +14311,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -16560,27 +14642,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_kvm_kvm_getenvv=yes else echo "$as_me: failed program was:" >&5 @@ -16589,7 +14655,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_kvm_kvm_getenvv=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -16870,27 +14936,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -16926,17 +14975,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -17031,27 +15073,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -17087,17 +15112,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -17190,27 +15208,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then have_forward_hook=yes else echo "$as_me: failed program was:" >&5 @@ -17267,27 +15268,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ffi_ok="yes" else echo "$as_me: failed program was:" >&5 @@ -17296,7 +15281,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ffi_ok="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $ffi_ok = yes; then { echo "$as_me:$LINENO: result: libffi" >&5 @@ -17338,27 +15323,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ffi_ok="yes" else echo "$as_me: failed program was:" >&5 @@ -17367,7 +15336,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ffi_ok="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $ffi_ok = yes; then { echo "$as_me:$LINENO: result: ffcall" >&5 @@ -17443,27 +15412,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then # libc has a working iconv. cat >>confdefs.h <<\_ACEOF @@ -17482,7 +15435,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $found_iconv = no ; then @@ -17530,27 +15483,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then # -liconv works. cat >>confdefs.h <<\_ACEOF @@ -17570,7 +15507,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -17597,27 +15534,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 @@ -17641,7 +15562,7 @@ echo "${ECHO_T}no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -17708,7 +15629,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -17750,7 +15671,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -18106,27 +16027,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -18162,17 +16066,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -18285,27 +16182,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_xslt_xsltApplyStylesheet=yes else echo "$as_me: failed program was:" >&5 @@ -18314,7 +16195,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_xslt_xsltApplyStylesheet=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -18361,27 +16242,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -18417,17 +16281,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -18530,6 +16387,227 @@ echo "$as_me: WARNING: Disabled support for XML funtionality." >&2;} fi +#-------------------------------------------------------------------- +# Check for NSNetServices +#-------------------------------------------------------------------- +HAVE_MDNS=0 + +for ac_header in dns_sd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + have_mdns=yes +else + have_mdns=no +fi + +done + +if test "$have_mdns" = "yes"; then + { echo "$as_me:$LINENO: checking for DNSServiceBrowse in -ldns_sd" >&5 +echo $ECHO_N "checking for DNSServiceBrowse in -ldns_sd... $ECHO_C" >&6; } +if test "${ac_cv_lib_dns_sd_DNSServiceBrowse+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldns_sd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char DNSServiceBrowse (); +int +main () +{ +return DNSServiceBrowse (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dns_sd_DNSServiceBrowse=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dns_sd_DNSServiceBrowse=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dns_sd_DNSServiceBrowse" >&5 +echo "${ECHO_T}$ac_cv_lib_dns_sd_DNSServiceBrowse" >&6; } +if test $ac_cv_lib_dns_sd_DNSServiceBrowse = yes; then + have_mdns=yes +else + have_mdns=no +fi + + if test "$have_mdns" = "yes"; then + LIBS="-ldns_sd $LIBS" + HAVE_MDNS=1 + fi +fi + + #-------------------------------------------------------------------- # Check GMP for NSDecimal #-------------------------------------------------------------------- @@ -18610,27 +16688,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -18666,17 +16727,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -18778,27 +16832,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gmp_mpf_abs=yes else echo "$as_me: failed program was:" >&5 @@ -18807,7 +16845,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gmp_mpf_abs=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -18862,27 +16900,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gmp___gmpf_abs=yes else echo "$as_me: failed program was:" >&5 @@ -18891,7 +16913,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gmp___gmpf_abs=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -18949,27 +16971,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 @@ -18978,7 +16984,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -19169,7 +17175,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -19178,10 +17185,13 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + + # PATH needs CR @@ -19405,19 +17415,28 @@ else as_mkdir_p=false fi -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_executable_p=: + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi -rm -f conf$$.file +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -19433,7 +17452,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -19461,7 +17480,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -19482,7 +17501,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.60, +configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. @@ -19811,6 +17830,7 @@ XML_CFLAGS!$XML_CFLAGS$ac_delim XML_LIBS!$XML_LIBS$ac_delim HAVE_LIBXSLT!$HAVE_LIBXSLT$ac_delim HAVE_LIBXML!$HAVE_LIBXML$ac_delim +HAVE_MDNS!$HAVE_MDNS$ac_delim USE_GMP!$USE_GMP$ac_delim INCLUDE_FLAGS!$INCLUDE_FLAGS$ac_delim LDIR_FLAGS!$LDIR_FLAGS$ac_delim @@ -19824,7 +17844,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 30; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -20296,7 +18316,12 @@ if test "$no_recursion" != yes; then case $ac_arg in *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - ac_sub_configure_args="$ac_arg $ac_sub_configure_args" + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue diff --git a/configure.ac b/configure.ac index 19b8cb902..53e81c518 100644 --- a/configure.ac +++ b/configure.ac @@ -1506,6 +1506,20 @@ else fi AC_SUBST(HAVE_LIBXML) +#-------------------------------------------------------------------- +# Check for NSNetServices +#-------------------------------------------------------------------- +HAVE_MDNS=0 +AC_CHECK_HEADERS(dns_sd.h, have_mdns=yes, have_mdns=no) +if test "$have_mdns" = "yes"; then + AC_CHECK_LIB(dns_sd, DNSServiceBrowse, have_mdns=yes, have_mdns=no) + if test "$have_mdns" = "yes"; then + LIBS="-ldns_sd $LIBS" + HAVE_MDNS=1 + fi +fi +AC_SUBST(HAVE_MDNS) + #-------------------------------------------------------------------- # Check GMP for NSDecimal #-------------------------------------------------------------------- From 69e0e201820b380ca5ce3196252995aefe52f828 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 27 Dec 2006 15:30:27 +0000 Subject: [PATCH 134/266] Fix keyed archiving error git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24273 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/GSString.m | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index e621fa6ca..31f4a050e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-12-27 Richard Frith-Macdonald + + * Source/GSString.m: Fix keyed archiving error. + 2006-12-27 Chris B. Vetter * Headers/Foundation/NSNetServices.h: New class diff --git a/Source/GSString.m b/Source/GSString.m index 794c371e4..75ce6b819 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -46,6 +46,7 @@ #include "Foundation/NSValue.h" #include "Foundation/NSDebug.h" #include "Foundation/NSObjCRuntime.h" +#include "Foundation/NSKeyedArchiver.h" #include "GNUstepBase/GSObjCRuntime.h" #include @@ -2843,6 +2844,12 @@ transmute(GSStr self, NSString *aString) - (void) encodeWithCoder: (NSCoder*)aCoder { + if ([aCoder allowsKeyedCoding]) + { + [(NSKeyedArchiver*)aCoder _encodePropertyList: self forKey: @"NS.string"]; + return; + } + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &_count]; if (_count > 0) { @@ -3149,6 +3156,12 @@ agree, create a new GSCInlineString otherwise. - (void) encodeWithCoder: (NSCoder*)aCoder { + if ([aCoder allowsKeyedCoding]) + { + [(NSKeyedArchiver*)aCoder _encodePropertyList: self forKey: @"NS.string"]; + return; + } + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &_count]; if (_count > 0) { @@ -3599,6 +3612,12 @@ NSAssert(_flags.free == 1 && _zone != 0, NSInternalInconsistencyException); - (void) encodeWithCoder: (NSCoder*)aCoder { + if ([aCoder allowsKeyedCoding]) + { + [(NSKeyedArchiver*)aCoder _encodePropertyList: self forKey: @"NS.string"]; + return; + } + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &_count]; if (_count > 0) { From f3ba38c1da6e74c586f9a1c7ac6f99bdd1106051 Mon Sep 17 00:00:00 2001 From: Graham J Lee Date: Fri, 29 Dec 2006 17:37:07 +0000 Subject: [PATCH 135/266] Fix for -[NSNumberFormatter stringForObjectValue:] which could crash on short format strings git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24293 72102866-910b-0410-8b05-ffd578937521 --- Source/NSNumberFormatter.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/NSNumberFormatter.m b/Source/NSNumberFormatter.m index 9fa46be07..463ea068f 100644 --- a/Source/NSNumberFormatter.m +++ b/Source/NSNumberFormatter.m @@ -630,13 +630,16 @@ //sort out the padding for the integer part intPartRange = [useFormat rangeOfCharacterFromSet: placeHolders]; - while (([placeHolders characterIsMember: - [useFormat characterAtIndex: NSMaxRange(intPartRange)]] - || [[useFormat substringFromRange: - NSMakeRange(NSMaxRange(intPartRange), 1)] isEqual: @","]) - && NSMaxRange(intPartRange) < [useFormat length] - 1) + if (NSMaxRange(intPartRange) < ([useFormat length] - 1)) { - intPartRange.length++; + while (([placeHolders characterIsMember: + [useFormat characterAtIndex: NSMaxRange(intPartRange)]] + || [[useFormat substringFromRange: + NSMakeRange(NSMaxRange(intPartRange), 1)] isEqual: @","]) + && NSMaxRange(intPartRange) < [useFormat length] - 1) + { + intPartRange.length++; + } } intPad = [[useFormat substringWithRange: intPartRange] mutableCopy]; [intPad replaceOccurrencesOfString: @"," From 8abd7f57432a9fd82e6936ee4c05bbb921088fbe Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 4 Jan 2007 08:36:08 +0000 Subject: [PATCH 136/266] Minor cleanup to avoid compiler warnings. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24311 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSBundle.m | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31f4a050e..3b8c0bf70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-04 Richard Frith-Macdonald + + * Source/NSBundle.m: (initialize) tiny cleanup to avoid compiler + warnings if compiled for NeXT runtime. + 2006-12-27 Richard Frith-Macdonald * Source/GSString.m: Fix keyed archiving error. diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 2f5d389b6..9f73dab43 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -719,8 +719,6 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) if (self == [NSBundle class]) { NSDictionary *env; - void *state = NULL; - Class class; _emptyTable = RETAIN([NSDictionary dictionary]); @@ -777,6 +775,9 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory) } #else { + void *state = NULL; + Class class; + while ((class = objc_next_class(&state))) { unsigned int len = strlen (class->name); From 9e1731fad68114f58903cac20970405212d6f783 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Sun, 7 Jan 2007 13:32:12 +0000 Subject: [PATCH 137/266] net service locking and various documentation fixes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24322 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 +++++++ Source/DocMakefile | 2 ++ Source/NSNetServices.m | 49 ++++++++++++++++++++++-------------------- Source/NSXMLParser.m | 28 ++++++++++++------------ 4 files changed, 50 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b8c0bf70..15627377e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-01-07 Richard Frith-Macdonald + + * Source/NSNetServices.m: Locking fix pointed out by Chris. + Fixes for documentation generation. + * Source/DocMakefile: Generate documentation for new classes. + * Source/NSXMLParser.m: Fix erroneous semicolons and other + autogsdoc warnings. + 2007-01-04 Richard Frith-Macdonald * Source/NSBundle.m: (initialize) tiny cleanup to avoid compiler diff --git a/Source/DocMakefile b/Source/DocMakefile index 349582f37..897e34bb7 100644 --- a/Source/DocMakefile +++ b/Source/DocMakefile @@ -75,6 +75,7 @@ NSKeyValueObserving.h \ NSLock.h \ NSMapTable.h \ NSMethodSignature.h \ +NSNetServices.h \ NSNotification.h \ NSNotificationQueue.h \ NSNull.h \ @@ -117,6 +118,7 @@ NSURLRequest.h \ NSURLResponse.h \ NSUserDefaults.h \ NSValue.h \ +NSValueTransformer.h \ NSXMLParser.h \ NSZone.h diff --git a/Source/NSNetServices.m b/Source/NSNetServices.m index f94fea73b..078f028ab 100644 --- a/Source/NSNetServices.m +++ b/Source/NSNetServices.m @@ -30,7 +30,9 @@ #import "Foundation/NSStream.h" #import "Foundation/NSTimer.h" #import "Foundation/NSValue.h" +#if defined(_REENTRANT) #import "GNUstepBase/GSLock.h" +#endif #import // Apple's DNS Service Discovery @@ -44,10 +46,6 @@ // Define // -#define PUBLIC /* public */ -#define PRIVATE static -#define EXTERN extern - #if ! defined(INET6_ADDRSTRLEN) # define INET6_ADDRSTRLEN 46 #endif @@ -78,8 +76,8 @@ } while(0); #if defined(_REENTRANT) -# define THE_LOCK GSLazyLock *lock -# define CREATELOCK(x) x->lock = [GSLazyLock new] +# define THE_LOCK GSLazyRecursiveLock *lock +# define CREATELOCK(x) x->lock = [GSLazyRecursiveLock new] # define LOCK(x) [x->lock lock] # define UNLOCK(x) [x->lock unlock] # define DESTROYLOCK(x) DESTROY(x->lock) @@ -194,21 +192,20 @@ NSString * const NSNetServicesErrorDomain = @"NSNetServicesErrorDomain"; // Prototype // -PRIVATE NSDictionary - *CreateError(id sender, - int errorCode); +static NSDictionary *CreateError(id sender, int errorCode); -PRIVATE int - ConvertError(int errorCode); +static int ConvertError(int errorCode); -PRIVATE void DNSSD_API +static void DNSSD_API // used by NSNetServiceBrowser EnumerationCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *replyDomain, - void *context), + void *context); + +static void DNSSD_API BrowserCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, @@ -216,7 +213,9 @@ PRIVATE void DNSSD_API const char *replyName, const char *replyType, const char *replyDomain, - void *context), + void *context); + +static void DNSSD_API // used by NSNetService ResolverCallback(DNSServiceRef sdRef, DNSServiceFlags flags, @@ -227,14 +226,18 @@ PRIVATE void DNSSD_API uint16_t port, uint16_t txtLen, const char *txtRecord, - void *context), + void *context); + +static void DNSSD_API RegistrationCallback(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, - void *context), + void *context); + +static void DNSSD_API // used by NSNetService and NSNetServiceMonitor QueryCallback(DNSServiceRef sdRef, DNSServiceFlags flags, @@ -3095,7 +3098,7 @@ PRIVATE void DNSSD_API * */ -PRIVATE NSDictionary * +static NSDictionary * CreateError(id sender, int errorCode) { NSMutableDictionary *dictionary = nil; @@ -3122,7 +3125,7 @@ CreateError(id sender, int errorCode) * */ -PRIVATE int +static int ConvertError(int errorCode) { INTERNALTRACE; @@ -3188,7 +3191,7 @@ ConvertError(int errorCode) * */ -PRIVATE void +static void EnumerationCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, @@ -3210,7 +3213,7 @@ EnumerationCallback(DNSServiceRef sdRef, * */ -PRIVATE void +static void BrowserCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, @@ -3236,7 +3239,7 @@ BrowserCallback(DNSServiceRef sdRef, * */ -PRIVATE void +static void ResolverCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, @@ -3266,7 +3269,7 @@ ResolverCallback(DNSServiceRef sdRef, * */ -PRIVATE void +static void RegistrationCallback(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, @@ -3290,7 +3293,7 @@ RegistrationCallback(DNSServiceRef sdRef, * */ -PRIVATE void +static void QueryCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, diff --git a/Source/NSXMLParser.m b/Source/NSXMLParser.m index 74557ed04..ec8309d19 100644 --- a/Source/NSXMLParser.m +++ b/Source/NSXMLParser.m @@ -500,7 +500,7 @@ typedef struct NSXMLParserIvarsType return this->column; } -- (void) dealloc; +- (void) dealloc { if (this != 0) { @@ -517,9 +517,9 @@ typedef struct NSXMLParserIvarsType return _del; } -- (id) initWithContentsOfURL: (NSURL *)url +- (id) initWithContentsOfURL: (NSURL *)anURL { - return [self initWithData: [NSData dataWithContentsOfURL: url]]; + return [self initWithData: [NSData dataWithContentsOfURL: anURL]]; } - (id) initWithData: (NSData *)data @@ -549,9 +549,9 @@ typedef struct NSXMLParserIvarsType return this->line; } -- (void) setDelegate: (id)del +- (void) setDelegate: (id)delegate { - _handler = del; + _handler = delegate; } - (NSError *) parserError @@ -674,7 +674,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); } } -- (NSString *) _entity; +- (NSString *) _entity { // parse &xxx; sequence int c; @@ -723,7 +723,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); return entity; } -- (NSString *) _qarg; +- (NSString *) _qarg { // get argument (might be quoted) const unsigned char *ap = --this->cp; // argument start pointer @@ -760,7 +760,7 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); return UTF8STR(ap, this->cp - ap); } -- (BOOL) parse; +- (BOOL) parse { // read XML (or HTML) file const unsigned char *vp = this->cp; // value pointer @@ -957,19 +957,19 @@ NSLog(@"_processTag <%@%@ %@>", flag?@"/": @"", tag, attributes); return this->shouldResolveExternalEntities; } -- (void) setShouldProcessNamespaces: (BOOL)flag +- (void) setShouldProcessNamespaces: (BOOL)aFlag { - this->shouldProcessNamespaces = flag; + this->shouldProcessNamespaces = aFlag; } -- (void) setShouldReportNamespacePrefixes: (BOOL)flag +- (void) setShouldReportNamespacePrefixes: (BOOL)aFlag { - this->shouldReportNamespacePrefixes = flag; + this->shouldReportNamespacePrefixes = aFlag; } -- (void) setShouldResolveExternalEntities: (BOOL)flag +- (void) setShouldResolveExternalEntities: (BOOL)aFlag { - this->shouldProcessNamespaces = flag; + this->shouldProcessNamespaces = aFlag; } - (void) _setAcceptHTML: (BOOL) flag From e9e445b9071f74f6963af20de1f596e146c0695c Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 15 Jan 2007 12:53:20 +0000 Subject: [PATCH 138/266] tweak foirmat of debug output to match MacOS-X git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24352 72102866-910b-0410-8b05-ffd578937521 --- Source/NSIndexSet.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/NSIndexSet.m b/Source/NSIndexSet.m index 8617b0fd1..04f756a74 100644 --- a/Source/NSIndexSet.m +++ b/Source/NSIndexSet.m @@ -247,14 +247,26 @@ static unsigned posForIndex(GSIArray array, unsigned index) unsigned c = (_array == 0) ? 0 : GSIArrayCount(_array); unsigned i; + if (c == 0) + { + return [NSString stringWithFormat: @"%@(no indexes)", + [super description]]; + } m = [NSMutableString stringWithFormat: - @"%@[number of indexes: %u (in %u ranges), indexes: ", + @"%@[number of indexes: %u (in %u ranges), indexes:", [super description], [self count], c]; for (i = 0; i < c; i++) { NSRange r = GSIArrayItemAtIndex(_array, i).ext; - [m appendFormat: @"(%u-%u) ", r.location, NSMaxRange(r) - 1]; + if (r.length > 1) + { + [m appendFormat: @" (%u-%u)", r.location, NSMaxRange(r) - 1]; + } + else + { + [m appendFormat: @" (%u)", r.location]; + } } [m appendString: @"]"]; return m; From 57f38ca92e891075f3f70d8ac3da3f2f6816fa5c Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Tue, 16 Jan 2007 01:09:20 +0000 Subject: [PATCH 139/266] Fixed help message git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24357 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ configure.ac | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15627377e..24f4b00a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-16 Nicola Pero + + * configure.ac: Fixed url of build guide given in error message + when ffcall/ffi is not found. + 2007-01-07 Richard Frith-Macdonald * Source/NSNetServices.m: Locking fix pointed out by Chris. diff --git a/configure.ac b/configure.ac index 53e81c518..37cb151b7 100644 --- a/configure.ac +++ b/configure.ac @@ -1358,7 +1358,7 @@ if test $ffi_ok = no; then echo "If you really want to build -base without DO support, add --disable-do" echo "to the configure arguments." echo "For more information, read the GNUstep build guide, ffcall section:" - echo "http://documents.made-it.com/GNUstep/buildguide.html#FOREIGN.FUNCTION.INTERFACES" + echo "http://gnustep.made-it.com/BuildGuide/index.html" AC_MSG_ERROR([Incomplete support for ffi functionality.]) fi AC_MSG_WARN([Incomplete support for ffi funtionality.]) From 510449d25537a27f48415360c01578b366926167 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Tue, 16 Jan 2007 06:40:28 +0000 Subject: [PATCH 140/266] Add release info for 10.13.1 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24366 72102866-910b-0410-8b05-ffd578937521 --- Documentation/ReleaseNotes.gsdoc | 71 +++++++++++++++++++++++++++++++- Documentation/news.texi | 14 +++++-- 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/Documentation/ReleaseNotes.gsdoc b/Documentation/ReleaseNotes.gsdoc index 0e8f044eb..ab87cfefb 100644 --- a/Documentation/ReleaseNotes.gsdoc +++ b/Documentation/ReleaseNotes.gsdoc @@ -1,5 +1,5 @@ - +