From 3dcc2ab2add19079a9fb19f53773a63a4dedfd78 Mon Sep 17 00:00:00 2001 From: rfm Date: Fri, 14 Oct 2011 11:40:34 +0000 Subject: [PATCH] solaris thread-saff errrno fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33983 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 20 ++++++++++++++++++++ Source/Additions/NSError+GNUstepBase.m | 4 ---- Source/Additions/Unicode.m | 1 - Source/GSFileHandle.m | 1 - Source/GSHTTPURLHandle.m | 2 -- Source/GSNetwork.h | 2 -- Source/GSPrivate.h | 5 +++++ Source/NSFileManager.m | 2 -- Source/NSLock.m | 2 +- Source/NSMessagePort.m | 1 - Source/NSProcessInfo.m | 4 ---- Source/NSSocketPort.m | 1 - Source/NSThread.m | 2 -- Source/NSUserDefaults.m | 1 - Source/inet_ntop.m | 1 - Source/inet_pton.m | 1 - Source/unix/NSStream.m | 1 - Source/win32/GSFileHandle.m | 1 - Source/win32/NSMessagePort.m | 1 - Source/win32/NSMessagePortNameServer.m | 2 -- 20 files changed, 26 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e0cbcf1f..f5f0b99be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,26 @@ * Source/GSString.m: Implement -hash for literal UTF-8 performance. * Source/NSScanner.m: Fix initialisation bug which could cause scanning to fail on some strings. + * Source/inet_pton.m: + * Source/NSProcessInfo.m: + * Source/NSSocketPort.m: + * Source/NSUserDefaults.m: + * Source/unix/NSStream.m: + * Source/inet_ntop.m: + * Source/GSHTTPURLHandle.m: + * Source/NSMessagePort.m: + * Source/GSPrivate.h: + * Source/win32/GSFileHandle.m: + * Source/win32/NSMessagePort.m: + * Source/win32/NSMessagePortNameServer.m: + * Source/NSFileManager.m: + * Source/Additions/Unicode.m: + * Source/Additions/NSError+GNUstepBase.m: + * Source/NSThread.m: + * Source/GSNetwork.h: + * Source/GSFileHandle.m: + * Source/NSLock.m: + Fix for thread-safe errno on solaris. 2011-10-12 Richard Frith-Macdonald diff --git a/Source/Additions/NSError+GNUstepBase.m b/Source/Additions/NSError+GNUstepBase.m index dce121100..b111c3f33 100644 --- a/Source/Additions/NSError+GNUstepBase.m +++ b/Source/Additions/NSError+GNUstepBase.m @@ -36,10 +36,6 @@ #import "Foundation/NSError.h" #import "GSPrivate.h" -#if !defined(__MINGW__) -#include -#endif - /** * GNUstep specific (non-standard) additions to the NSError class. * Possibly to be made public diff --git a/Source/Additions/Unicode.m b/Source/Additions/Unicode.m index 01f462a03..d0daa0265 100644 --- a/Source/Additions/Unicode.m +++ b/Source/Additions/Unicode.m @@ -71,7 +71,6 @@ typedef struct {unichar from; unsigned char to;} _ucc_; #else #include #endif -#include /* * The whole of the GNUstep code stores UNICODE in internal byte order, diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index 7b6d8a6f2..caf3e9754 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -64,7 +64,6 @@ #ifdef HAVE_UNISTD_H #include #endif -#include /* * Stuff for setting the sockets into non-blocking mode. diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index 396a1806a..5916c7533 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -62,8 +62,6 @@ #include // For MSG_PEEK, etc #endif -#include - /* * Implement map keys for strings with case insensitive comparisons, * so we can have case insensitive matching of http headers (correct diff --git a/Source/GSNetwork.h b/Source/GSNetwork.h index 13f0caf58..6a33e5948 100644 --- a/Source/GSNetwork.h +++ b/Source/GSNetwork.h @@ -28,12 +28,10 @@ Boston, MA 02111 USA. */ - #ifdef HAVE_UNISTD_H #include #endif -#include #include #include #include diff --git a/Source/GSPrivate.h b/Source/GSPrivate.h index 0451d5e00..bfe64ab94 100644 --- a/Source/GSPrivate.h +++ b/Source/GSPrivate.h @@ -24,6 +24,11 @@ #ifndef _GSPrivate_h_ #define _GSPrivate_h_ +/* Generally may need this for posix thread-safe errno + */ +#define _XOPEN_SOURCE 600 +#include + #import "Foundation/NSError.h" @class _GSInsensitiveDictionary; diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index 3f2d1a885..21057312f 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -147,8 +147,6 @@ #include #endif -#include - #ifdef HAVE_SYS_STAT_H #include #endif diff --git a/Source/NSLock.m b/Source/NSLock.m index 2ba2b5b49..3a3294be1 100644 --- a/Source/NSLock.m +++ b/Source/NSLock.m @@ -25,10 +25,10 @@ #import "common.h" #include #import "GNUstepBase/GSConfig.h" +#import "GSPrivate.h" #define gs_cond_t pthread_cond_t #define gs_mutex_t pthread_mutex_t #include -#include #define EXPOSE_NSLock_IVARS 1 #define EXPOSE_NSRecursiveLock_IVARS 1 diff --git a/Source/NSMessagePort.m b/Source/NSMessagePort.m index 33e0a2492..8de239cb0 100644 --- a/Source/NSMessagePort.m +++ b/Source/NSMessagePort.m @@ -58,7 +58,6 @@ #include #include #include /* for inet_ntoa() */ -#include #include /* for strchr() */ #include /* for strchr() */ #include diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 6e91adcd1..fe1c600dc 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -59,10 +59,6 @@ #include #endif -#ifdef HAVE_STRERROR -#include -#endif /* HAVE_STRERROR */ - #include #include diff --git a/Source/NSSocketPort.m b/Source/NSSocketPort.m index d080e8c46..851f44301 100644 --- a/Source/NSSocketPort.m +++ b/Source/NSSocketPort.m @@ -60,7 +60,6 @@ #include #include /* for inet_ntoa() */ #endif /* !__MINGW__ */ -#include #include /* for strchr() */ #include /* for strchr() */ #include diff --git a/Source/NSThread.m b/Source/NSThread.m index b06ac1c14..47b5be34d 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -55,8 +55,6 @@ #include #endif -#include - #ifdef __POSIX_SOURCE #define NBLK_OPT O_NONBLOCK #else diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index 891068c61..4312a87d8 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -31,7 +31,6 @@ #define EXPOSE_NSUserDefaults_IVARS 1 #include #include -#include #import "Foundation/NSUserDefaults.h" #import "Foundation/NSArchiver.h" diff --git a/Source/inet_ntop.m b/Source/inet_ntop.m index 2b46a930b..d289d9e4b 100644 --- a/Source/inet_ntop.m +++ b/Source/inet_ntop.m @@ -22,7 +22,6 @@ #include #include #include -#include #import "GSPrivate.h" #import "GSNetwork.h" diff --git a/Source/inet_pton.m b/Source/inet_pton.m index 0b34acb7c..c17727ef4 100644 --- a/Source/inet_pton.m +++ b/Source/inet_pton.m @@ -26,7 +26,6 @@ #include #include -#include #import "GSPrivate.h" #import "GSNetwork.h" diff --git a/Source/unix/NSStream.m b/Source/unix/NSStream.m index f6c3c1a1f..5fd74f973 100644 --- a/Source/unix/NSStream.m +++ b/Source/unix/NSStream.m @@ -25,7 +25,6 @@ #import "common.h" #include -#include #import "Foundation/NSData.h" #import "Foundation/NSArray.h" diff --git a/Source/win32/GSFileHandle.m b/Source/win32/GSFileHandle.m index 4b01e7aee..4f7cbd14a 100644 --- a/Source/win32/GSFileHandle.m +++ b/Source/win32/GSFileHandle.m @@ -57,7 +57,6 @@ #ifdef HAVE_UNISTD_H #include #endif -#include #ifndef O_BINARY #ifdef _O_BINARY diff --git a/Source/win32/NSMessagePort.m b/Source/win32/NSMessagePort.m index f3200ccbe..8c4dda02f 100644 --- a/Source/win32/NSMessagePort.m +++ b/Source/win32/NSMessagePort.m @@ -47,7 +47,6 @@ #include "../GSPortPrivate.h" #include -#include #define UNISTR(X) \ ((const unichar*)[(X) cStringUsingEncoding: NSUnicodeStringEncoding]) diff --git a/Source/win32/NSMessagePortNameServer.m b/Source/win32/NSMessagePortNameServer.m index c866b0bca..0d412f325 100644 --- a/Source/win32/NSMessagePortNameServer.m +++ b/Source/win32/NSMessagePortNameServer.m @@ -42,8 +42,6 @@ #include "GNUstepBase/GSMime.h" -#include - #include "../GSPrivate.h" #include "../GSPortPrivate.h"