From bb610b0e30faa2ac1622433678b8f918f39bac48 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 1 Mar 2012 09:14:08 +0000 Subject: [PATCH] experimental change to try to avoid non-standard extensions git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34852 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 11 +++++++++++ Source/Additions/NSError+GNUstepBase.m | 12 +++--------- Source/GSRunLoopCtxt.h | 8 ++++---- Source/GSRunLoopWatcher.h | 4 ++-- Source/GSURLPrivate.h | 2 +- Source/NSXMLPrivate.h | 7 ++++--- Source/common.h | 6 ++++++ Source/inet_ntop.m | 2 +- 8 files changed, 32 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index b079ceb05..2cf4ae544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-03-01 Richard Frith-Macdonald + + * Source/GSRunLoopWatcher.h: + * Source/NSXMLPrivate.h: + * Source/GSRunLoopCtxt.h: + * Source/common.h: + * Source/Additions/NSError+GNUstepBase.m: + * Source/GSURLPrivate.h: + Include config.h via common.h ... and have that turn off _GNU_SOURCE + so GNU extensions aren't used and we stick to standard strerror_r + 2012-03-01 Fred Kiefer * Source/NSXMLNode.m: More cleanup. diff --git a/Source/Additions/NSError+GNUstepBase.m b/Source/Additions/NSError+GNUstepBase.m index ece5a95ef..047cccb06 100644 --- a/Source/Additions/NSError+GNUstepBase.m +++ b/Source/Additions/NSError+GNUstepBase.m @@ -23,24 +23,18 @@ */ -/* Carefully turn off _GNU_SOURCE and on _XOPEN_SOURCE for string.h so we +/* Carefully turn on _XOPEN_SOURCE for string.h so we * get the POSIX strerror_r */ -#ifdef _GNU_SOURCE -#undef _GNU_SOURCE -#define _GNU_SOURCE 0 -#endif #ifdef _XOPEN_SOURCE #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #endif -#include -#undef _GNU_SOURCE -#undef _XOPEN_SOURCE -#import "config.h" +#import "common.h" #include +#include #import "Foundation/NSDictionary.h" #import "Foundation/NSError.h" diff --git a/Source/GSRunLoopCtxt.h b/Source/GSRunLoopCtxt.h index 6ecfb9fc4..3d5e530ff 100644 --- a/Source/GSRunLoopCtxt.h +++ b/Source/GSRunLoopCtxt.h @@ -25,10 +25,10 @@ $Date$ $Revision$ */ -#include "config.h" -#include -#include -#include +#import "common.h" +#import "Foundation/NSException.h" +#import "Foundation/NSMapTable.h" +#import "Foundation/NSRunLoop.h" /* * Setup for inline operation of arrays. diff --git a/Source/GSRunLoopWatcher.h b/Source/GSRunLoopWatcher.h index e59961af3..0812692fe 100644 --- a/Source/GSRunLoopWatcher.h +++ b/Source/GSRunLoopWatcher.h @@ -54,8 +54,8 @@ * NB. This class is private to NSRunLoop and must not be subclassed. */ -#include "config.h" -#include +#import "common.h" +#import "Foundation/NSRunLoop.h" @class NSDate; diff --git a/Source/GSURLPrivate.h b/Source/GSURLPrivate.h index 4da1fbb8b..6b75bd894 100644 --- a/Source/GSURLPrivate.h +++ b/Source/GSURLPrivate.h @@ -27,7 +27,7 @@ /* * Headers needed by many URL loading classes */ -#import "config.h" +#import "common.h" #import "Foundation/NSArray.h" #import "Foundation/NSAutoreleasePool.h" #import "Foundation/NSData.h" diff --git a/Source/NSXMLPrivate.h b/Source/NSXMLPrivate.h index d8f72d091..78d6b33ba 100644 --- a/Source/NSXMLPrivate.h +++ b/Source/NSXMLPrivate.h @@ -25,8 +25,7 @@ #ifndef _INCLUDED_NSXMLPRIVATE_H #define _INCLUDED_NSXMLPRIVATE_H -#import "config.h" -#import "GNUstepBase/GSConfig.h" +#import "common.h" #define EXPOSE_NSXMLDTD_IVARS 1 #define EXPOSE_NSXMLDTDNode_IVARS 1 @@ -42,7 +41,9 @@ inline static unsigned char *XMLStringCopy(NSString *source) { char *xmlstr; - unsigned int len = [source maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1; + unsigned int len; + + len = [source maximumLengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1; if (len == 0) return NULL; xmlstr = malloc(len); diff --git a/Source/common.h b/Source/common.h index 7d97bf840..c3b8a0e7b 100644 --- a/Source/common.h +++ b/Source/common.h @@ -4,6 +4,12 @@ * might be from an earlier build. */ +// disable extensions ... we want to use standard code +#ifdef _GNU_SOURCE +#undef _GNU_SOURCE +#endif +#define _GNU_SOURCE 0 + #import "config.h" /* If this is included in a file in the Additions subdirectory, and we are diff --git a/Source/inet_ntop.m b/Source/inet_ntop.m index d289d9e4b..fedd04e7b 100644 --- a/Source/inet_ntop.m +++ b/Source/inet_ntop.m @@ -16,7 +16,7 @@ * SOFTWARE. */ -#include "config.h" +#import "common.h" #include #include