diff --git a/ChangeLog b/ChangeLog index dce8a7159..f495e65fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2002-05-02 Richard Frith-Macdonald + + * 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 * configure.ac: Updated to autoconf 2.53 from configure.in diff --git a/SSL/GSUnixSSLHandle.m b/SSL/GSUnixSSLHandle.m index 464f99a59..9ecb988d4 100644 --- a/SSL/GSUnixSSLHandle.m +++ b/SSL/GSUnixSSLHandle.m @@ -76,7 +76,7 @@ #endif #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/GSFormat.m b/Source/GSFormat.m index 143988913..5dc869a02 100644 --- a/Source/GSFormat.m +++ b/Source/GSFormat.m @@ -65,7 +65,7 @@ #include #include // for strstr() #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index aca160c99..f33a1eb31 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -38,7 +38,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/GSTcpPort.m b/Source/GSTcpPort.m index f8025dc10..6f8978512 100644 --- a/Source/GSTcpPort.m +++ b/Source/GSTcpPort.m @@ -41,7 +41,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include /* for gethostname() */ #endif diff --git a/Source/NSBundle.m b/Source/NSBundle.m index c6ac1e237..9957ebd2a 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -49,7 +49,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/NSData.m b/Source/NSData.m index 319764581..776614f6d 100644 --- a/Source/NSData.m +++ b/Source/NSData.m @@ -79,11 +79,11 @@ #include #include #include /* for memset() */ -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include /* SEEK_* on SunOS 4 */ #endif -#if HAVE_MMAP +#ifdef HAVE_MMAP #include #include #include @@ -97,7 +97,7 @@ #include #endif -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL #include #include @@ -351,12 +351,12 @@ failure: - (void) _grow: (unsigned int)minimum; @end -#if HAVE_MMAP +#ifdef HAVE_MMAP @interface NSDataMappedFile : NSDataMalloc @end #endif -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL @interface NSDataShared : NSDataMalloc { int shmid; @@ -443,7 +443,7 @@ failure: { NSData *d; -#if HAVE_MMAP +#ifdef HAVE_MMAP d = [NSDataMappedFile allocWithZone: NSDefaultMallocZone()]; d = [d initWithContentsOfMappedFile: path]; #else @@ -529,7 +529,7 @@ failure: - (id) initWithContentsOfMappedFile: (NSString *)path { -#if HAVE_MMAP +#ifdef HAVE_MMAP RELEASE(self); self = [NSDataMappedFile allocWithZone: GSObjCZone(self)]; return [self initWithContentsOfMappedFile: path]; @@ -1306,7 +1306,7 @@ failure: @implementation NSData (GNUstepExtensions) + (id) dataWithShmID: (int)anID length: (unsigned int)length { -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL NSDataShared *d; d = [NSDataShared allocWithZone: NSDefaultMallocZone()]; @@ -1322,7 +1322,7 @@ failure: { NSData *d; -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL d = [NSDataShared allocWithZone: NSDefaultMallocZone()]; d = [d initWithBytes: bytes length: length]; #else @@ -1870,7 +1870,7 @@ failure: @implementation NSMutableData (GNUstepExtensions) + (id) dataWithShmID: (int)anID length: (unsigned int)length { -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL NSDataShared *d; d = [NSMutableDataShared allocWithZone: NSDefaultMallocZone()]; @@ -1886,7 +1886,7 @@ failure: { NSData *d; -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL d = [NSMutableDataShared allocWithZone: NSDefaultMallocZone()]; d = [d initWithBytes: bytes length: length]; #else @@ -2429,7 +2429,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) @end -#if HAVE_MMAP +#ifdef HAVE_MMAP @implementation NSDataMappedFile + (id) allocWithZone: (NSZone*)z { @@ -2497,7 +2497,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) @end #endif /* HAVE_MMAP */ -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL @implementation NSDataShared + (id) allocWithZone: (NSZone*)z { @@ -3156,7 +3156,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos) @end -#if HAVE_SHMCTL +#ifdef HAVE_SHMCTL @implementation NSMutableDataShared + (id) allocWithZone: (NSZone*)z { diff --git a/Source/NSDate.m b/Source/NSDate.m index 259fc283c..17e61a1e7 100644 --- a/Source/NSDate.m +++ b/Source/NSDate.m @@ -42,7 +42,7 @@ #include #include #include -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif #include diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index abbf32f88..5c2b6256a 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -56,10 +56,10 @@ # include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif -#if HAVE_WINDOWS_H +#ifdef HAVE_WINDOWS_H # include #endif @@ -77,7 +77,7 @@ # include # endif #else -# if HAVE_SYS_PARAM_H +# ifdef HAVE_SYS_PARAM_H # include /* for MAXPATHLEN */ # endif #endif @@ -107,11 +107,11 @@ # include #endif -#if HAVE_SYS_FILE_H +#ifdef HAVE_SYS_FILE_H #include #endif -#if HAVE_SYS_MOUNT_H +#ifdef HAVE_SYS_MOUNT_H #include #endif @@ -122,13 +122,13 @@ #endif #include -#if HAVE_PWD_H +#ifdef HAVE_PWD_H #include /* For struct passwd */ #endif -#if HAVE_GRP_H +#ifdef HAVE_GRP_H #include /* For struct group */ #endif -#if HAVE_UTIME_H +#ifdef HAVE_UTIME_H # include #endif @@ -1017,9 +1017,10 @@ static NSFileManager* defaultManager = nil; return [NSDictionary dictionaryWithObjects: values forKeys: keys count: 5]; #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; -#if HAVE_STATVFS +#ifdef HAVE_STATVFS struct statvfs statfsbuf; #else struct statfs statfsbuf; @@ -1039,7 +1040,7 @@ static NSFileManager* defaultManager = nil; if (stat(cpath, &statbuf) != 0) return nil; -#if HAVE_STATVFS +#ifdef HAVE_STATVFS if (statvfs(cpath, &statfsbuf) != 0) return nil; #else @@ -1090,7 +1091,7 @@ static NSFileManager* defaultManager = nil; if ((str = [attributes objectForKey: NSFileOwnerAccountName]) != nil) { BOOL ok = NO; -#if HAVE_PWD_H +#ifdef HAVE_PWD_H struct passwd *pw = getpwnam([str cString]); if (pw) @@ -1123,7 +1124,7 @@ static NSFileManager* defaultManager = nil; else if ((str=[attributes objectForKey: NSFileGroupOwnerAccountName]) != nil) { BOOL ok = NO; -#if HAVE_GRP_H +#ifdef HAVE_GRP_H struct group *gp = getgrnam([str cString]); if (gp) @@ -1280,7 +1281,7 @@ static NSFileManager* defaultManager = nil; - (BOOL) createSymbolicLinkAtPath: (NSString*)path pathContent: (NSString*)otherPath { -#if HAVE_SYMLINK +#ifdef HAVE_SYMLINK const char* newpath = [self fileSystemRepresentationWithPath: path]; const char* oldpath = [self fileSystemRepresentationWithPath: otherPath]; @@ -1292,7 +1293,7 @@ static NSFileManager* defaultManager = nil; - (NSString*) pathContentOfSymbolicLinkAtPath: (NSString*)path { -#if HAVE_READLINK +#ifdef HAVE_READLINK char lpath[PATH_MAX]; const char* cpath = [self fileSystemRepresentationWithPath: path]; int llen = readlink(cpath, lpath, PATH_MAX-1); @@ -2206,7 +2207,7 @@ static int sparc_warn = 0; if (copy == NO) { -#if HAVE_PWD_H +#ifdef HAVE_PWD_H { 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 * to be the owner of copied files. */ -#if HAVE_GETEUID +#ifdef HAVE_GETEUID if (geteuid() == 0 && [@"root" isEqualToString: u] == NO) { values[count++] = u; diff --git a/Source/NSHost.m b/Source/NSHost.m index 2d440c7fa..7bbf1f75b 100644 --- a/Source/NSHost.m +++ b/Source/NSHost.m @@ -41,7 +41,7 @@ #include #else #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/NSLock.m b/Source/NSLock.m index 4fc1304f4..5e2c47402 100644 --- a/Source/NSLock.m +++ b/Source/NSLock.m @@ -26,7 +26,7 @@ #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/NSLog.m b/Source/NSLog.m index eba349504..fea502df9 100644 --- a/Source/NSLog.m +++ b/Source/NSLog.m @@ -40,7 +40,7 @@ #include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/Source/NSPage.m b/Source/NSPage.m index 3f5bcaac5..32de38835 100644 --- a/Source/NSPage.m +++ b/Source/NSPage.m @@ -32,7 +32,7 @@ #ifdef __WIN32__ #include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include @@ -143,7 +143,7 @@ NSAllocateMemoryPages (unsigned bytes) return NULL; return where; #else -#if HAVE_VALLOC +#ifdef HAVE_VALLOC where = valloc (bytes); #else where = malloc (bytes); diff --git a/Source/NSPipe.m b/Source/NSPipe.m index 7b6fd9e68..c56e7933f 100644 --- a/Source/NSPipe.m +++ b/Source/NSPipe.m @@ -29,7 +29,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 852c909a9..5367a5f37 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -56,7 +56,7 @@ #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif diff --git a/Source/NSRunLoop.m b/Source/NSRunLoop.m index 59da9cd7e..3a4e4a4d6 100644 --- a/Source/NSRunLoop.m +++ b/Source/NSRunLoop.m @@ -41,16 +41,16 @@ #include #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H #include #endif -#if HAVE_SYS_TIME_H +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_POLL_H +#ifdef HAVE_POLL_H #include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include @@ -62,7 +62,7 @@ static NSDate *theFuture = nil; extern BOOL GSCheckTasks(); -#if HAVE_POLL +#ifdef HAVE_POLL typedef struct { int limit; short *index; @@ -396,7 +396,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks = NSMapTable *_wfdMap; int fairStart; // For trying to ensure fair handling. BOOL completed; // To mark operation as completed. -#if HAVE_POLL +#ifdef HAVE_POLL int pollfds_capacity; int pollfds_count; struct pollfd *pollfds; @@ -431,7 +431,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks = { NSFreeMapTable(_wfdMap); } -#if HAVE_POLL +#ifdef HAVE_POLL if (pollfds != 0) { objc_free(pollfds); @@ -515,7 +515,7 @@ const NSMapTableValueCallBacks ArrayMapValueCallBacks = return self; } -#if HAVE_POLL +#ifdef HAVE_POLL static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt) { @@ -1619,7 +1619,7 @@ if (0) { _contextMap = NSCreateMapTable (NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); _timedPerformers = [[NSMutableArray alloc] initWithCapacity: 8]; -#if HAVE_POLL +#ifdef HAVE_POLL _extra = objc_malloc(sizeof(pollextra)); memset(_extra, '\0', sizeof(pollextra)); #endif @@ -1635,7 +1635,7 @@ if (0) { - (void) gcFinalize { -#if HAVE_POLL +#ifdef HAVE_POLL if (_extra != 0) { pollextra *e = (pollextra*)_extra; diff --git a/Source/NSString.m b/Source/NSString.m index 08756e5c4..62b950513 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -68,7 +68,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include @@ -262,7 +262,7 @@ static NSRange highSurrogateRange = {0xD800, 1024}; static NSRange lowSurrogateRange = {0xDC00, 1024}; -#if HAVE_REGISTER_PRINTF_FUNCTION +#ifdef HAVE_REGISTER_PRINTF_FUNCTION #include #include #include @@ -359,7 +359,7 @@ handle_printf_atsign (FILE *stream, NSNonRetainedObjectMapValueCallBacks, 0); placeholderLock = [NSLock new]; -#if HAVE_REGISTER_PRINTF_FUNCTION +#ifdef HAVE_REGISTER_PRINTF_FUNCTION if (register_printf_function ('@', handle_printf_atsign, #if PRINTF_ATSIGN_VA_LIST @@ -792,7 +792,7 @@ handle_printf_atsign (FILE *stream, #if defined(HAVE_VSPRINTF) || defined(HAVE_VASPRINTF) const char *format_cp = [format lossyCString]; int format_len = strlen (format_cp); -#if HAVE_VASPRINTF +#ifdef HAVE_VASPRINTF char *buf; int printed_len = 0; NSString *ret; @@ -2848,7 +2848,7 @@ handle_printf_atsign (FILE *stream, #define MAX_PATH 1024 #endif char new_buf[MAX_PATH]; -#if HAVE_REALPATH +#ifdef HAVE_REALPATH if (realpath([self cString], new_buf) == 0) return self; @@ -4048,7 +4048,7 @@ handle_printf_atsign (FILE *stream, -#if HAVE_LIBXML +#ifdef HAVE_LIBXML #include static int XML_ELEMENT_NODE; @@ -4597,7 +4597,7 @@ static id parsePlItem(pldata* pld) return result; } -#if HAVE_LIBXML +#ifdef HAVE_LIBXML static GSXMLNode* elementNode(GSXMLNode* node) { @@ -4827,7 +4827,7 @@ nodeToObject(GSXMLNode* node) static void setupPl() { -#if HAVE_LIBXML +#ifdef HAVE_LIBXML /* * Cache XML node information. */ @@ -4859,7 +4859,7 @@ GSPropertyList(NSString *string) unsigned length = [string length]; NSData *d; id pl; -#if HAVE_LIBXML +#ifdef HAVE_LIBXML unsigned index = 0; #endif @@ -4876,7 +4876,7 @@ GSPropertyList(NSString *string) setupPl(); } -#if HAVE_LIBXML +#ifdef HAVE_LIBXML if (whitespaceBitmapRep == NULL) { setupWhitespace(); diff --git a/Source/NSTask.m b/Source/NSTask.m index 5758909f3..6eaee7bc6 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -45,7 +45,7 @@ #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include @@ -53,29 +53,29 @@ #include #endif -#if HAVE_WINDOWS_H +#ifdef HAVE_WINDOWS_H # include #endif -#if HAVE_SYS_SIGNAL_H +#ifdef HAVE_SYS_SIGNAL_H #include #endif -#if HAVE_SIGNAL_H +#ifdef HAVE_SIGNAL_H #include #endif -#if HAVE_SYS_FILE_H +#ifdef HAVE_SYS_FILE_H #include #endif -#if HAVE_SYS_FCNTL_H +#ifdef HAVE_SYS_FCNTL_H #include #endif -#if HAVE_SYS_IOCTL_H +#ifdef HAVE_SYS_IOCTL_H #include #endif -#if HAVE_SYS_WAIT_H +#ifdef HAVE_SYS_WAIT_H #include #endif -#if HAVE_SYS_PARAM_H +#ifdef HAVE_SYS_PARAM_H #include #endif @@ -83,7 +83,7 @@ * If we are on a streams based system, we need to include stropts.h * for definitions needed to set up slave pseudo-terminal stream. */ -#if HAVE_SYS_STROPTS_H +#ifdef HAVE_SYS_STROPTS_H #include #endif @@ -139,7 +139,7 @@ pty_master(char* name, int len) * If we have grantpt(), assume we are using sysv-style pseudo-terminals, * otherwise assume bsd style. */ -#if HAVE_GRANTPT +#ifdef HAVE_GRANTPT master = open("/dev/ptmx", O_RDWR); if (master >= 0) { @@ -194,8 +194,8 @@ pty_slave(const char* name) int slave; slave = open(name, O_RDWR); -#if HAVE_SYS_STROPTS_H -#if HAVE_PTS_STREAM_MODULES +#ifdef HAVE_SYS_STROPTS_H +#ifdef HAVE_PTS_STREAM_MODULES if (slave >= 0 && isastream(slave)) { if (ioctl(slave, I_PUSH, "ptem") < 0) @@ -1249,7 +1249,7 @@ GSCheckTasks() /* * Make sure task is run in it's own process group. */ -#if HAVE_SETPGRP +#ifdef HAVE_SETPGRP #ifdef SETPGRP_VOID setpgrp(); #else @@ -1261,7 +1261,7 @@ GSCheckTasks() #else pid = (int)getpid(); #endif -#if HAVE_SETPGID +#ifdef HAVE_SETPGID setpgid(pid, pid); #endif #endif @@ -1276,7 +1276,7 @@ GSCheckTasks() exit(1); /* Failed to open slave! */ } -#if HAVE_SETSID +#ifdef HAVE_SETSID i = setsid(); #endif #ifdef TIOCNOTTY diff --git a/Source/NSThread.m b/Source/NSThread.m index 2d23da2d3..06d50f537 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -32,7 +32,7 @@ #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Source/NSUser.m b/Source/NSUser.m index 3e5cb5fff..e2308a924 100644 --- a/Source/NSUser.m +++ b/Source/NSUser.m @@ -42,10 +42,10 @@ #include "GSPrivate.h" #include // for getenv() -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include // for getlogin() #endif -#if HAVE_PWD_H +#ifdef HAVE_PWD_H #include // for getpwnam() #endif #include @@ -150,7 +150,7 @@ NSUserName(void) loginName = buf; #else loginName = getenv("LOGNAME"); -#if HAVE_GETPWNAM +#ifdef HAVE_GETPWNAM /* * Check that LOGNAME contained legal name. */ @@ -159,7 +159,7 @@ NSUserName(void) loginName = 0; } #endif /* HAVE_GETPWNAM */ -#if HAVE_GETLOGIN +#ifdef HAVE_GETLOGIN /* * Try getlogin() if LOGNAME environmentm variable didn't work. */ @@ -168,13 +168,13 @@ NSUserName(void) loginName = getlogin(); } #endif /* HAVE_GETLOGIN */ -#if HAVE_GETPWUID +#ifdef HAVE_GETPWUID /* * Try getting the name of the effective user as a last resort. */ if (loginName == 0) { -#if HAVE_GETEUID +#ifdef HAVE_GETEUID int uid = geteuid(); #else int uid = getuid(); @@ -280,7 +280,7 @@ NSHomeDirectoryForUser(NSString *loginName) NSString * NSFullUserName(void) { -#if HAVE_PWD_H +#ifdef HAVE_PWD_H struct passwd *pw; pw = getpwnam([NSUserName() cString]); diff --git a/Source/UnixFileHandle.m b/Source/UnixFileHandle.m index c8d6ed003..6269a1ce1 100644 --- a/Source/UnixFileHandle.m +++ b/Source/UnixFileHandle.m @@ -61,7 +61,7 @@ #endif #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include @@ -222,7 +222,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) [self ignoreReadDescriptor]; [self ignoreWriteDescriptor]; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB /* * 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]; if (isStandardFile) { -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 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 { -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 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) [self setNonBlocking: NO]; d = [NSMutableData dataWithCapacity: 0]; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 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); d = [NSMutableData dataWithBytesNoCopy: buf length: len]; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { 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; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { got = gzread(gzDescriptor, buf, chunk); @@ -908,7 +908,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) { toWrite = NETBUF_SIZE; } -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { 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 HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { 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 HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { 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 HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { 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 setNonBlocking: wasNonBlocking]; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { gzclose(gzDescriptor); @@ -1435,7 +1435,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) item = [readInfo objectForKey: NSFileHandleNotificationDataItem]; length = [item length]; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { received = gzread(gzDescriptor, buf, sizeof(buf)); @@ -1489,7 +1489,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) { int written; -#if HAVE_ZLIB +#ifdef HAVE_ZLIB if (gzDescriptor != 0) { written = gzwrite(gzDescriptor, (char*)ptr+writePos, @@ -1608,7 +1608,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) - (BOOL) useCompression { -#if HAVE_ZLIB +#ifdef HAVE_ZLIB int d; if (gzDescriptor != 0) diff --git a/Source/WindowsFileHandle.m b/Source/WindowsFileHandle.m index 95f7c6c21..1cfd5cbed 100644 --- a/Source/WindowsFileHandle.m +++ b/Source/WindowsFileHandle.m @@ -46,7 +46,7 @@ #include #include #include -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H #include #endif #include diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 370aba298..c1a999caa 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -381,7 +381,7 @@ main(int argc, char **argv, char **env) [NSProcessInfo initializeWithArguments: argv count: argc environment: env]; #endif -#if HAVE_LIBXML == 0 +#ifdef HAVE_LIBXML == 0 NSLog(@"ERROR: The GNUstep Base Library was built\n" @" without an available libxml library. Autogsdoc needs the libxml\n" @" library to function. Aborting"); diff --git a/Tools/gsdoc.m b/Tools/gsdoc.m index 88b42c8a9..00cb527a5 100644 --- a/Tools/gsdoc.m +++ b/Tools/gsdoc.m @@ -84,7 +84,7 @@ Parameters: #include -#if HAVE_LIBXML +#ifdef HAVE_LIBXML #include #include