Fixes to get stuff to work after autoconf changes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13578 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-05-02 21:22:06 +00:00
parent 9824bb0bbc
commit 79f3f57034
24 changed files with 135 additions and 106 deletions

View file

@ -1,3 +1,31 @@
2002-05-02 Richard Frith-Macdonald <rfm@gnu.org>
* SSL/GSUnixSSLHandle.m: Change '#if HAVE...' to '#ifdef HAVE_...'
* Source/GSFormat.m: ditto
* Source/GSHTTPURLHandle.m: ditto
* Source/GSTcpPort.m: ditto
* Source/NSBundle.m: ditto
* Source/NSData.m: ditto
* Source/NSDate.m: ditto
* Source/NSFileManager.m: ditto
* Source/NSHost.m: ditto
* Source/NSLock.m: ditto
* Source/NSLog.m: ditto
* Source/NSPage.m: ditto
* Source/NSPipe.m: ditto
* Source/NSProcessInfo.m: ditto
* Source/NSRunLoop.m: ditto
* Source/NSString.m: ditto
* Source/NSTask.m: ditto
* Source/NSThread.m: ditto
* Source/NSUser.m: ditto
* Source/UnixFileHandle.m: ditto
* Source/WindowsFileHandle.m: ditto
* Tools/gsdoc.m: ditto
* Tools/autogsdoc.m: ditto
Fixes to handle configuration changes where AC_DEFINE is setting
preprocessor constants to be empty (but defined) rather than to be 1
2002-05-02 Adam Fedor <fedor@gnu.org> 2002-05-02 Adam Fedor <fedor@gnu.org>
* configure.ac: Updated to autoconf 2.53 from configure.in * configure.ac: Updated to autoconf 2.53 from configure.in

View file

@ -76,7 +76,7 @@
#endif #endif
#include <netdb.h> #include <netdb.h>
#include <string.h> #include <string.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <errno.h> #include <errno.h>

View file

@ -65,7 +65,7 @@
#include <limits.h> #include <limits.h>
#include <string.h> // for strstr() #include <string.h> // for strstr()
#include <sys/stat.h> #include <sys/stat.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>

View file

@ -38,7 +38,7 @@
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#include <Foundation/GSMime.h> #include <Foundation/GSMime.h>
#include <string.h> #include <string.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/file.h> #include <sys/file.h>

View file

@ -41,7 +41,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> /* for gethostname() */ #include <unistd.h> /* for gethostname() */
#endif #endif

View file

@ -49,7 +49,7 @@
#include <Foundation/NSFileManager.h> #include <Foundation/NSFileManager.h>
#include <Foundation/NSPathUtilities.h> #include <Foundation/NSPathUtilities.h>
#include <Foundation/NSValue.h> #include <Foundation/NSValue.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <string.h> #include <string.h>

View file

@ -79,11 +79,11 @@
#include <Foundation/NSZone.h> #include <Foundation/NSZone.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> /* for memset() */ #include <string.h> /* for memset() */
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> /* SEEK_* on SunOS 4 */ #include <unistd.h> /* SEEK_* on SunOS 4 */
#endif #endif
#if HAVE_MMAP #ifdef HAVE_MMAP
#include <unistd.h> #include <unistd.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <fcntl.h> #include <fcntl.h>
@ -97,7 +97,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/shm.h> #include <sys/shm.h>
@ -351,12 +351,12 @@ failure:
- (void) _grow: (unsigned int)minimum; - (void) _grow: (unsigned int)minimum;
@end @end
#if HAVE_MMAP #ifdef HAVE_MMAP
@interface NSDataMappedFile : NSDataMalloc @interface NSDataMappedFile : NSDataMalloc
@end @end
#endif #endif
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
@interface NSDataShared : NSDataMalloc @interface NSDataShared : NSDataMalloc
{ {
int shmid; int shmid;
@ -443,7 +443,7 @@ failure:
{ {
NSData *d; NSData *d;
#if HAVE_MMAP #ifdef HAVE_MMAP
d = [NSDataMappedFile allocWithZone: NSDefaultMallocZone()]; d = [NSDataMappedFile allocWithZone: NSDefaultMallocZone()];
d = [d initWithContentsOfMappedFile: path]; d = [d initWithContentsOfMappedFile: path];
#else #else
@ -529,7 +529,7 @@ failure:
- (id) initWithContentsOfMappedFile: (NSString *)path - (id) initWithContentsOfMappedFile: (NSString *)path
{ {
#if HAVE_MMAP #ifdef HAVE_MMAP
RELEASE(self); RELEASE(self);
self = [NSDataMappedFile allocWithZone: GSObjCZone(self)]; self = [NSDataMappedFile allocWithZone: GSObjCZone(self)];
return [self initWithContentsOfMappedFile: path]; return [self initWithContentsOfMappedFile: path];
@ -1306,7 +1306,7 @@ failure:
@implementation NSData (GNUstepExtensions) @implementation NSData (GNUstepExtensions)
+ (id) dataWithShmID: (int)anID length: (unsigned int)length + (id) dataWithShmID: (int)anID length: (unsigned int)length
{ {
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
NSDataShared *d; NSDataShared *d;
d = [NSDataShared allocWithZone: NSDefaultMallocZone()]; d = [NSDataShared allocWithZone: NSDefaultMallocZone()];
@ -1322,7 +1322,7 @@ failure:
{ {
NSData *d; NSData *d;
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
d = [NSDataShared allocWithZone: NSDefaultMallocZone()]; d = [NSDataShared allocWithZone: NSDefaultMallocZone()];
d = [d initWithBytes: bytes length: length]; d = [d initWithBytes: bytes length: length];
#else #else
@ -1870,7 +1870,7 @@ failure:
@implementation NSMutableData (GNUstepExtensions) @implementation NSMutableData (GNUstepExtensions)
+ (id) dataWithShmID: (int)anID length: (unsigned int)length + (id) dataWithShmID: (int)anID length: (unsigned int)length
{ {
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
NSDataShared *d; NSDataShared *d;
d = [NSMutableDataShared allocWithZone: NSDefaultMallocZone()]; d = [NSMutableDataShared allocWithZone: NSDefaultMallocZone()];
@ -1886,7 +1886,7 @@ failure:
{ {
NSData *d; NSData *d;
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
d = [NSMutableDataShared allocWithZone: NSDefaultMallocZone()]; d = [NSMutableDataShared allocWithZone: NSDefaultMallocZone()];
d = [d initWithBytes: bytes length: length]; d = [d initWithBytes: bytes length: length];
#else #else
@ -2429,7 +2429,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
@end @end
#if HAVE_MMAP #ifdef HAVE_MMAP
@implementation NSDataMappedFile @implementation NSDataMappedFile
+ (id) allocWithZone: (NSZone*)z + (id) allocWithZone: (NSZone*)z
{ {
@ -2497,7 +2497,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
@end @end
#endif /* HAVE_MMAP */ #endif /* HAVE_MMAP */
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
@implementation NSDataShared @implementation NSDataShared
+ (id) allocWithZone: (NSZone*)z + (id) allocWithZone: (NSZone*)z
{ {
@ -3156,7 +3156,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
@end @end
#if HAVE_SHMCTL #ifdef HAVE_SHMCTL
@implementation NSMutableDataShared @implementation NSMutableDataShared
+ (id) allocWithZone: (NSZone*)z + (id) allocWithZone: (NSZone*)z
{ {

View file

@ -42,7 +42,7 @@
#include <Foundation/NSUserDefaults.h> #include <Foundation/NSUserDefaults.h>
#include <base/preface.h> #include <base/preface.h>
#include <base/behavior.h> #include <base/behavior.h>
#if HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include <time.h> #include <time.h>

View file

@ -56,10 +56,10 @@
# include <ndir.h> # include <ndir.h>
#endif #endif
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#if HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
# include <windows.h> # include <windows.h>
#endif #endif
@ -77,7 +77,7 @@
# include <utime.h> # include <utime.h>
# endif # endif
#else #else
# if HAVE_SYS_PARAM_H # ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> /* for MAXPATHLEN */ # include <sys/param.h> /* for MAXPATHLEN */
# endif # endif
#endif #endif
@ -107,11 +107,11 @@
# include <sys/statfs.h> # include <sys/statfs.h>
#endif #endif
#if HAVE_SYS_FILE_H #ifdef HAVE_SYS_FILE_H
#include <sys/file.h> #include <sys/file.h>
#endif #endif
#if HAVE_SYS_MOUNT_H #ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h> #include <sys/mount.h>
#endif #endif
@ -122,13 +122,13 @@
#endif #endif
#include <fcntl.h> #include <fcntl.h>
#if HAVE_PWD_H #ifdef HAVE_PWD_H
#include <pwd.h> /* For struct passwd */ #include <pwd.h> /* For struct passwd */
#endif #endif
#if HAVE_GRP_H #ifdef HAVE_GRP_H
#include <grp.h> /* For struct group */ #include <grp.h> /* For struct group */
#endif #endif
#if HAVE_UTIME_H #ifdef HAVE_UTIME_H
# include <utime.h> # include <utime.h>
#endif #endif
@ -1017,9 +1017,10 @@ static NSFileManager* defaultManager = nil;
return [NSDictionary dictionaryWithObjects: values forKeys: keys count: 5]; return [NSDictionary dictionaryWithObjects: values forKeys: keys count: 5];
#else #else
#if HAVE_SYS_VFS_H || HAVE_SYS_STATFS_H || HAVE_SYS_MOUNT_H #if defined(HAVE_SYS_VFS_H) || defined(HAVE_SYS_STATFS_H) \
|| defined(HAVE_SYS_MOUNT_H)
struct stat statbuf; struct stat statbuf;
#if HAVE_STATVFS #ifdef HAVE_STATVFS
struct statvfs statfsbuf; struct statvfs statfsbuf;
#else #else
struct statfs statfsbuf; struct statfs statfsbuf;
@ -1039,7 +1040,7 @@ static NSFileManager* defaultManager = nil;
if (stat(cpath, &statbuf) != 0) if (stat(cpath, &statbuf) != 0)
return nil; return nil;
#if HAVE_STATVFS #ifdef HAVE_STATVFS
if (statvfs(cpath, &statfsbuf) != 0) if (statvfs(cpath, &statfsbuf) != 0)
return nil; return nil;
#else #else
@ -1090,7 +1091,7 @@ static NSFileManager* defaultManager = nil;
if ((str = [attributes objectForKey: NSFileOwnerAccountName]) != nil) if ((str = [attributes objectForKey: NSFileOwnerAccountName]) != nil)
{ {
BOOL ok = NO; BOOL ok = NO;
#if HAVE_PWD_H #ifdef HAVE_PWD_H
struct passwd *pw = getpwnam([str cString]); struct passwd *pw = getpwnam([str cString]);
if (pw) if (pw)
@ -1123,7 +1124,7 @@ static NSFileManager* defaultManager = nil;
else if ((str=[attributes objectForKey: NSFileGroupOwnerAccountName]) != nil) else if ((str=[attributes objectForKey: NSFileGroupOwnerAccountName]) != nil)
{ {
BOOL ok = NO; BOOL ok = NO;
#if HAVE_GRP_H #ifdef HAVE_GRP_H
struct group *gp = getgrnam([str cString]); struct group *gp = getgrnam([str cString]);
if (gp) if (gp)
@ -1280,7 +1281,7 @@ static NSFileManager* defaultManager = nil;
- (BOOL) createSymbolicLinkAtPath: (NSString*)path - (BOOL) createSymbolicLinkAtPath: (NSString*)path
pathContent: (NSString*)otherPath pathContent: (NSString*)otherPath
{ {
#if HAVE_SYMLINK #ifdef HAVE_SYMLINK
const char* newpath = [self fileSystemRepresentationWithPath: path]; const char* newpath = [self fileSystemRepresentationWithPath: path];
const char* oldpath = [self fileSystemRepresentationWithPath: otherPath]; const char* oldpath = [self fileSystemRepresentationWithPath: otherPath];
@ -1292,7 +1293,7 @@ static NSFileManager* defaultManager = nil;
- (NSString*) pathContentOfSymbolicLinkAtPath: (NSString*)path - (NSString*) pathContentOfSymbolicLinkAtPath: (NSString*)path
{ {
#if HAVE_READLINK #ifdef HAVE_READLINK
char lpath[PATH_MAX]; char lpath[PATH_MAX];
const char* cpath = [self fileSystemRepresentationWithPath: path]; const char* cpath = [self fileSystemRepresentationWithPath: path];
int llen = readlink(cpath, lpath, PATH_MAX-1); int llen = readlink(cpath, lpath, PATH_MAX-1);
@ -2206,7 +2207,7 @@ static int sparc_warn = 0;
if (copy == NO) if (copy == NO)
{ {
#if HAVE_PWD_H #ifdef HAVE_PWD_H
{ {
struct passwd *pw; struct passwd *pw;
@ -2271,7 +2272,7 @@ static int sparc_warn = 0;
* If we are running setuid to root - we need to specify the user * If we are running setuid to root - we need to specify the user
* to be the owner of copied files. * to be the owner of copied files.
*/ */
#if HAVE_GETEUID #ifdef HAVE_GETEUID
if (geteuid() == 0 && [@"root" isEqualToString: u] == NO) if (geteuid() == 0 && [@"root" isEqualToString: u] == NO)
{ {
values[count++] = u; values[count++] = u;

View file

@ -41,7 +41,7 @@
#include <winsock2.h> #include <winsock2.h>
#else #else
#include <netdb.h> #include <netdb.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/param.h> #include <sys/param.h>

View file

@ -26,7 +26,7 @@
#include <config.h> #include <config.h>
#include <errno.h> #include <errno.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <base/preface.h> #include <base/preface.h>

View file

@ -40,7 +40,7 @@
#include <syslog.h> #include <syslog.h>
#endif #endif
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif

View file

@ -32,7 +32,7 @@
#ifdef __WIN32__ #ifdef __WIN32__
#include <malloc.h> #include <malloc.h>
#endif #endif
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -143,7 +143,7 @@ NSAllocateMemoryPages (unsigned bytes)
return NULL; return NULL;
return where; return where;
#else #else
#if HAVE_VALLOC #ifdef HAVE_VALLOC
where = valloc (bytes); where = valloc (bytes);
#else #else
where = malloc (bytes); where = malloc (bytes);

View file

@ -29,7 +29,7 @@
#include <Foundation/NSObject.h> #include <Foundation/NSObject.h>
#include <Foundation/NSFileHandle.h> #include <Foundation/NSFileHandle.h>
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif

View file

@ -56,7 +56,7 @@
#include <config.h> #include <config.h>
#include <base/preface.h> #include <base/preface.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif

View file

@ -41,16 +41,16 @@
#include <Foundation/NSThread.h> #include <Foundation/NSThread.h>
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#if HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#if HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#if HAVE_POLL_H #ifdef HAVE_POLL_H
#include <poll.h> #include <poll.h>
#endif #endif
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <time.h> #include <time.h>
@ -62,7 +62,7 @@ static NSDate *theFuture = nil;
extern BOOL GSCheckTasks(); extern BOOL GSCheckTasks();
#if HAVE_POLL #ifdef HAVE_POLL
typedef struct { typedef struct {
int limit; int limit;
short *index; short *index;
@ -396,7 +396,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
NSMapTable *_wfdMap; NSMapTable *_wfdMap;
int fairStart; // For trying to ensure fair handling. int fairStart; // For trying to ensure fair handling.
BOOL completed; // To mark operation as completed. BOOL completed; // To mark operation as completed.
#if HAVE_POLL #ifdef HAVE_POLL
int pollfds_capacity; int pollfds_capacity;
int pollfds_count; int pollfds_count;
struct pollfd *pollfds; struct pollfd *pollfds;
@ -431,7 +431,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
{ {
NSFreeMapTable(_wfdMap); NSFreeMapTable(_wfdMap);
} }
#if HAVE_POLL #ifdef HAVE_POLL
if (pollfds != 0) if (pollfds != 0)
{ {
objc_free(pollfds); objc_free(pollfds);
@ -515,7 +515,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks =
return self; return self;
} }
#if HAVE_POLL #ifdef HAVE_POLL
static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt) static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
{ {
@ -1619,7 +1619,7 @@ if (0) {
_contextMap = NSCreateMapTable (NSNonRetainedObjectMapKeyCallBacks, _contextMap = NSCreateMapTable (NSNonRetainedObjectMapKeyCallBacks,
NSObjectMapValueCallBacks, 0); NSObjectMapValueCallBacks, 0);
_timedPerformers = [[NSMutableArray alloc] initWithCapacity: 8]; _timedPerformers = [[NSMutableArray alloc] initWithCapacity: 8];
#if HAVE_POLL #ifdef HAVE_POLL
_extra = objc_malloc(sizeof(pollextra)); _extra = objc_malloc(sizeof(pollextra));
memset(_extra, '\0', sizeof(pollextra)); memset(_extra, '\0', sizeof(pollextra));
#endif #endif
@ -1635,7 +1635,7 @@ if (0) {
- (void) gcFinalize - (void) gcFinalize
{ {
#if HAVE_POLL #ifdef HAVE_POLL
if (_extra != 0) if (_extra != 0)
{ {
pollextra *e = (pollextra*)_extra; pollextra *e = (pollextra*)_extra;

View file

@ -68,7 +68,7 @@
#include <base/GSFormat.h> #include <base/GSFormat.h>
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@ -262,7 +262,7 @@ static NSRange highSurrogateRange = {0xD800, 1024};
static NSRange lowSurrogateRange = {0xDC00, 1024}; static NSRange lowSurrogateRange = {0xDC00, 1024};
#if HAVE_REGISTER_PRINTF_FUNCTION #ifdef HAVE_REGISTER_PRINTF_FUNCTION
#include <stdio.h> #include <stdio.h>
#include <printf.h> #include <printf.h>
#include <stdarg.h> #include <stdarg.h>
@ -359,7 +359,7 @@ handle_printf_atsign (FILE *stream,
NSNonRetainedObjectMapValueCallBacks, 0); NSNonRetainedObjectMapValueCallBacks, 0);
placeholderLock = [NSLock new]; placeholderLock = [NSLock new];
#if HAVE_REGISTER_PRINTF_FUNCTION #ifdef HAVE_REGISTER_PRINTF_FUNCTION
if (register_printf_function ('@', if (register_printf_function ('@',
handle_printf_atsign, handle_printf_atsign,
#if PRINTF_ATSIGN_VA_LIST #if PRINTF_ATSIGN_VA_LIST
@ -792,7 +792,7 @@ handle_printf_atsign (FILE *stream,
#if defined(HAVE_VSPRINTF) || defined(HAVE_VASPRINTF) #if defined(HAVE_VSPRINTF) || defined(HAVE_VASPRINTF)
const char *format_cp = [format lossyCString]; const char *format_cp = [format lossyCString];
int format_len = strlen (format_cp); int format_len = strlen (format_cp);
#if HAVE_VASPRINTF #ifdef HAVE_VASPRINTF
char *buf; char *buf;
int printed_len = 0; int printed_len = 0;
NSString *ret; NSString *ret;
@ -2848,7 +2848,7 @@ handle_printf_atsign (FILE *stream,
#define MAX_PATH 1024 #define MAX_PATH 1024
#endif #endif
char new_buf[MAX_PATH]; char new_buf[MAX_PATH];
#if HAVE_REALPATH #ifdef HAVE_REALPATH
if (realpath([self cString], new_buf) == 0) if (realpath([self cString], new_buf) == 0)
return self; return self;
@ -4048,7 +4048,7 @@ handle_printf_atsign (FILE *stream,
#if HAVE_LIBXML #ifdef HAVE_LIBXML
#include <Foundation/GSXML.h> #include <Foundation/GSXML.h>
static int XML_ELEMENT_NODE; static int XML_ELEMENT_NODE;
@ -4597,7 +4597,7 @@ static id parsePlItem(pldata* pld)
return result; return result;
} }
#if HAVE_LIBXML #ifdef HAVE_LIBXML
static GSXMLNode* static GSXMLNode*
elementNode(GSXMLNode* node) elementNode(GSXMLNode* node)
{ {
@ -4827,7 +4827,7 @@ nodeToObject(GSXMLNode* node)
static void static void
setupPl() setupPl()
{ {
#if HAVE_LIBXML #ifdef HAVE_LIBXML
/* /*
* Cache XML node information. * Cache XML node information.
*/ */
@ -4859,7 +4859,7 @@ GSPropertyList(NSString *string)
unsigned length = [string length]; unsigned length = [string length];
NSData *d; NSData *d;
id pl; id pl;
#if HAVE_LIBXML #ifdef HAVE_LIBXML
unsigned index = 0; unsigned index = 0;
#endif #endif
@ -4876,7 +4876,7 @@ GSPropertyList(NSString *string)
setupPl(); setupPl();
} }
#if HAVE_LIBXML #ifdef HAVE_LIBXML
if (whitespaceBitmapRep == NULL) if (whitespaceBitmapRep == NULL)
{ {
setupWhitespace(); setupWhitespace();

View file

@ -45,7 +45,7 @@
#include <Foundation/NSDebug.h> #include <Foundation/NSDebug.h>
#include <string.h> #include <string.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@ -53,29 +53,29 @@
#include <fcntl.h> #include <fcntl.h>
#endif #endif
#if HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
# include <windows.h> # include <windows.h>
#endif #endif
#if HAVE_SYS_SIGNAL_H #ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h> #include <sys/signal.h>
#endif #endif
#if HAVE_SIGNAL_H #ifdef HAVE_SIGNAL_H
#include <signal.h> #include <signal.h>
#endif #endif
#if HAVE_SYS_FILE_H #ifdef HAVE_SYS_FILE_H
#include <sys/file.h> #include <sys/file.h>
#endif #endif
#if HAVE_SYS_FCNTL_H #ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h> #include <sys/fcntl.h>
#endif #endif
#if HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#if HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> #include <sys/param.h>
#endif #endif
@ -83,7 +83,7 @@
* If we are on a streams based system, we need to include stropts.h * If we are on a streams based system, we need to include stropts.h
* for definitions needed to set up slave pseudo-terminal stream. * for definitions needed to set up slave pseudo-terminal stream.
*/ */
#if HAVE_SYS_STROPTS_H #ifdef HAVE_SYS_STROPTS_H
#include <sys/stropts.h> #include <sys/stropts.h>
#endif #endif
@ -139,7 +139,7 @@ pty_master(char* name, int len)
* If we have grantpt(), assume we are using sysv-style pseudo-terminals, * If we have grantpt(), assume we are using sysv-style pseudo-terminals,
* otherwise assume bsd style. * otherwise assume bsd style.
*/ */
#if HAVE_GRANTPT #ifdef HAVE_GRANTPT
master = open("/dev/ptmx", O_RDWR); master = open("/dev/ptmx", O_RDWR);
if (master >= 0) if (master >= 0)
{ {
@ -194,8 +194,8 @@ pty_slave(const char* name)
int slave; int slave;
slave = open(name, O_RDWR); slave = open(name, O_RDWR);
#if HAVE_SYS_STROPTS_H #ifdef HAVE_SYS_STROPTS_H
#if HAVE_PTS_STREAM_MODULES #ifdef HAVE_PTS_STREAM_MODULES
if (slave >= 0 && isastream(slave)) if (slave >= 0 && isastream(slave))
{ {
if (ioctl(slave, I_PUSH, "ptem") < 0) if (ioctl(slave, I_PUSH, "ptem") < 0)
@ -1249,7 +1249,7 @@ GSCheckTasks()
/* /*
* Make sure task is run in it's own process group. * Make sure task is run in it's own process group.
*/ */
#if HAVE_SETPGRP #ifdef HAVE_SETPGRP
#ifdef SETPGRP_VOID #ifdef SETPGRP_VOID
setpgrp(); setpgrp();
#else #else
@ -1261,7 +1261,7 @@ GSCheckTasks()
#else #else
pid = (int)getpid(); pid = (int)getpid();
#endif #endif
#if HAVE_SETPGID #ifdef HAVE_SETPGID
setpgid(pid, pid); setpgid(pid, pid);
#endif #endif
#endif #endif
@ -1276,7 +1276,7 @@ GSCheckTasks()
exit(1); /* Failed to open slave! */ exit(1); /* Failed to open slave! */
} }
#if HAVE_SETSID #ifdef HAVE_SETSID
i = setsid(); i = setsid();
#endif #endif
#ifdef TIOCNOTTY #ifdef TIOCNOTTY

View file

@ -32,7 +32,7 @@
#include <config.h> #include <config.h>
#include <base/preface.h> #include <base/preface.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <Foundation/NSThread.h> #include <Foundation/NSThread.h>

View file

@ -42,10 +42,10 @@
#include "GSPrivate.h" #include "GSPrivate.h"
#include <stdlib.h> // for getenv() #include <stdlib.h> // for getenv()
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> // for getlogin() #include <unistd.h> // for getlogin()
#endif #endif
#if HAVE_PWD_H #ifdef HAVE_PWD_H
#include <pwd.h> // for getpwnam() #include <pwd.h> // for getpwnam()
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@ -150,7 +150,7 @@ NSUserName(void)
loginName = buf; loginName = buf;
#else #else
loginName = getenv("LOGNAME"); loginName = getenv("LOGNAME");
#if HAVE_GETPWNAM #ifdef HAVE_GETPWNAM
/* /*
* Check that LOGNAME contained legal name. * Check that LOGNAME contained legal name.
*/ */
@ -159,7 +159,7 @@ NSUserName(void)
loginName = 0; loginName = 0;
} }
#endif /* HAVE_GETPWNAM */ #endif /* HAVE_GETPWNAM */
#if HAVE_GETLOGIN #ifdef HAVE_GETLOGIN
/* /*
* Try getlogin() if LOGNAME environmentm variable didn't work. * Try getlogin() if LOGNAME environmentm variable didn't work.
*/ */
@ -168,13 +168,13 @@ NSUserName(void)
loginName = getlogin(); loginName = getlogin();
} }
#endif /* HAVE_GETLOGIN */ #endif /* HAVE_GETLOGIN */
#if HAVE_GETPWUID #ifdef HAVE_GETPWUID
/* /*
* Try getting the name of the effective user as a last resort. * Try getting the name of the effective user as a last resort.
*/ */
if (loginName == 0) if (loginName == 0)
{ {
#if HAVE_GETEUID #ifdef HAVE_GETEUID
int uid = geteuid(); int uid = geteuid();
#else #else
int uid = getuid(); int uid = getuid();
@ -280,7 +280,7 @@ NSHomeDirectoryForUser(NSString *loginName)
NSString * NSString *
NSFullUserName(void) NSFullUserName(void)
{ {
#if HAVE_PWD_H #ifdef HAVE_PWD_H
struct passwd *pw; struct passwd *pw;
pw = getpwnam([NSUserName() cString]); pw = getpwnam([NSUserName() cString]);

View file

@ -61,7 +61,7 @@
#endif #endif
#include <netdb.h> #include <netdb.h>
#include <string.h> #include <string.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <errno.h> #include <errno.h>
@ -222,7 +222,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
[self ignoreReadDescriptor]; [self ignoreReadDescriptor];
[self ignoreWriteDescriptor]; [self ignoreWriteDescriptor];
#if HAVE_ZLIB #ifdef HAVE_ZLIB
/* /*
* The gzDescriptor should always be closed when we have done with it. * The gzDescriptor should always be closed when we have done with it.
*/ */
@ -750,7 +750,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
d = [NSMutableData dataWithCapacity: 0]; d = [NSMutableData dataWithCapacity: 0];
if (isStandardFile) if (isStandardFile)
{ {
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
while ((len = gzread(gzDescriptor, buf, sizeof(buf))) > 0) while ((len = gzread(gzDescriptor, buf, sizeof(buf))) > 0)
@ -767,7 +767,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
} }
else else
{ {
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
if ((len = gzread(gzDescriptor, buf, sizeof(buf))) > 0) if ((len = gzread(gzDescriptor, buf, sizeof(buf))) > 0)
@ -801,7 +801,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
if (isNonBlocking == YES) if (isNonBlocking == YES)
[self setNonBlocking: NO]; [self setNonBlocking: NO];
d = [NSMutableData dataWithCapacity: 0]; d = [NSMutableData dataWithCapacity: 0];
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
while ((len = gzread(gzDescriptor, buf, sizeof(buf))) > 0) while ((len = gzread(gzDescriptor, buf, sizeof(buf))) > 0)
@ -838,7 +838,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
buf = NSZoneMalloc(NSDefaultMallocZone(), len); buf = NSZoneMalloc(NSDefaultMallocZone(), len);
d = [NSMutableData dataWithBytesNoCopy: buf length: len]; d = [NSMutableData dataWithBytesNoCopy: buf length: len];
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
got = gzread(gzDescriptor, [d mutableBytes], len); got = gzread(gzDescriptor, [d mutableBytes], len);
@ -863,7 +863,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
{ {
int chunk = len > sizeof(buf) ? sizeof(buf) : len; int chunk = len > sizeof(buf) ? sizeof(buf) : len;
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
got = gzread(gzDescriptor, buf, chunk); got = gzread(gzDescriptor, buf, chunk);
@ -908,7 +908,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
{ {
toWrite = NETBUF_SIZE; toWrite = NETBUF_SIZE;
} }
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
rval = gzwrite(gzDescriptor, (char*)ptr+pos, toWrite); rval = gzwrite(gzDescriptor, (char*)ptr+pos, toWrite);
@ -1018,7 +1018,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
if (isStandardFile && descriptor >= 0) if (isStandardFile && descriptor >= 0)
{ {
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
result = gzseek(gzDescriptor, 0, SEEK_CUR); result = gzseek(gzDescriptor, 0, SEEK_CUR);
@ -1042,7 +1042,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
if (isStandardFile && descriptor >= 0) if (isStandardFile && descriptor >= 0)
{ {
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
result = gzseek(gzDescriptor, 0, SEEK_END); result = gzseek(gzDescriptor, 0, SEEK_END);
@ -1066,7 +1066,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
if (isStandardFile && descriptor >= 0) if (isStandardFile && descriptor >= 0)
{ {
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
result = gzseek(gzDescriptor, (off_t)pos, SEEK_SET); result = gzseek(gzDescriptor, (off_t)pos, SEEK_SET);
@ -1096,7 +1096,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
[self ignoreWriteDescriptor]; [self ignoreWriteDescriptor];
[self setNonBlocking: wasNonBlocking]; [self setNonBlocking: wasNonBlocking];
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
gzclose(gzDescriptor); gzclose(gzDescriptor);
@ -1435,7 +1435,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
item = [readInfo objectForKey: NSFileHandleNotificationDataItem]; item = [readInfo objectForKey: NSFileHandleNotificationDataItem];
length = [item length]; length = [item length];
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
received = gzread(gzDescriptor, buf, sizeof(buf)); received = gzread(gzDescriptor, buf, sizeof(buf));
@ -1489,7 +1489,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
{ {
int written; int written;
#if HAVE_ZLIB #ifdef HAVE_ZLIB
if (gzDescriptor != 0) if (gzDescriptor != 0)
{ {
written = gzwrite(gzDescriptor, (char*)ptr+writePos, written = gzwrite(gzDescriptor, (char*)ptr+writePos,
@ -1608,7 +1608,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
- (BOOL) useCompression - (BOOL) useCompression
{ {
#if HAVE_ZLIB #ifdef HAVE_ZLIB
int d; int d;
if (gzDescriptor != 0) if (gzDescriptor != 0)

View file

@ -46,7 +46,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h> #include <string.h>
#if HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <io.h> #include <io.h>

View file

@ -381,7 +381,7 @@ main(int argc, char **argv, char **env)
[NSProcessInfo initializeWithArguments: argv count: argc environment: env]; [NSProcessInfo initializeWithArguments: argv count: argc environment: env];
#endif #endif
#if HAVE_LIBXML == 0 #ifdef HAVE_LIBXML == 0
NSLog(@"ERROR: The GNUstep Base Library was built\n" NSLog(@"ERROR: The GNUstep Base Library was built\n"
@" without an available libxml library. Autogsdoc needs the libxml\n" @" without an available libxml library. Autogsdoc needs the libxml\n"
@" library to function. Aborting"); @" library to function. Aborting");

View file

@ -84,7 +84,7 @@ Parameters:
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
#if HAVE_LIBXML #ifdef HAVE_LIBXML
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>