Use __MINGW32__ rather than __MINGW__ because gcc does that too.

NB. It seems some recent patches put ___MINGW32__ in the public headers ...
that needs to be fixed as the headers should be system independent!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-10-11 19:09:26 +00:00
parent 9ce257fccf
commit 620e39b898
40 changed files with 247 additions and 247 deletions

View file

@ -58,7 +58,7 @@
#if USE_ZLIB #if USE_ZLIB
gzFile gzDescriptor; gzFile gzDescriptor;
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
WSAEVENT event; WSAEVENT event;
#endif #endif
} }

View file

@ -39,12 +39,12 @@ typedef struct{
GSIArray performers; /** The actions to perform regularly. */ GSIArray performers; /** The actions to perform regularly. */
GSIArray timers; /** The timers set for the runloop mode */ GSIArray timers; /** The timers set for the runloop mode */
GSIArray watchers; /** The inputs set for the runloop mode */ GSIArray watchers; /** The inputs set for the runloop mode */
#if defined(__MINGW__) #if defined(__MINGW32__)
id msgTarget; /** Target to raise a win32 message */ id msgTarget; /** Target to raise a win32 message */
SEL msgSelector; /** method of target */ SEL msgSelector; /** method of target */
#endif #endif
@private @private
#if defined(__MINGW__) #if defined(__MINGW32__)
NSMapTable *handleMap; NSMapTable *handleMap;
#else #else
NSMapTable *_efdMap; NSMapTable *_efdMap;

View file

@ -31,7 +31,7 @@
#include <Foundation/NSObject.h> #include <Foundation/NSObject.h>
#include <Foundation/NSMapTable.h> #include <Foundation/NSMapTable.h>
#if defined(__MINGW__) #if defined(__MINGW32__)
#include <winsock2.h> #include <winsock2.h>
#include <wininet.h> #include <wininet.h>
#else #else
@ -193,7 +193,7 @@ typedef SOCKET NSSocketNativeHandle;
gsu16 portNum; /* TCP port in host byte order. */ gsu16 portNum; /* TCP port in host byte order. */
SOCKET listener; SOCKET listener;
NSMapTable *handles; /* Handles indexed by socket. */ NSMapTable *handles; /* Handles indexed by socket. */
#if defined(__MINGW__) #if defined(__MINGW32__)
WSAEVENT eventListener; WSAEVENT eventListener;
NSMapTable *events; NSMapTable *events;
#endif #endif
@ -317,7 +317,7 @@ typedef SOCKET NSSocketNativeHandle;
NSRecursiveLock *myLock; NSRecursiveLock *myLock;
NSMapTable *handles; /* Handles indexed by socket. */ NSMapTable *handles; /* Handles indexed by socket. */
int listener; /* Descriptor to listen on. */ int listener; /* Descriptor to listen on. */
#if defined(__MINGW__) #if defined(__MINGW32__)
WSAEVENT eventListener; WSAEVENT eventListener;
NSMapTable *events; NSMapTable *events;
#endif #endif

View file

@ -108,7 +108,7 @@ GS_EXPORT NSString * const NSDefaultRunLoopMode;
</example> </example>
*/ */
typedef enum { typedef enum {
#ifdef __MINGW__ #ifdef __MINGW32__
ET_HANDLE, ET_HANDLE,
ET_RPORT /* Watch for message arriving on port. */ ET_RPORT /* Watch for message arriving on port. */
#else #else
@ -199,7 +199,7 @@ typedef enum {
- (void) getFds: (int*)fds count: (int*)count; - (void) getFds: (int*)fds count: (int*)count;
@end @end
#if defined(__MINGW__) #if defined(__MINGW32__)
/** /**
* Interface that add method to set target for win32 messages.<br /> * Interface that add method to set target for win32 messages.<br />
*/ */

View file

@ -57,7 +57,7 @@
#include <GNUstepBase/GSFileHandle.h> #include <GNUstepBase/GSFileHandle.h>
#if defined(__MINGW__) #if defined(__MINGW32__)
#include <winsock2.h> #include <winsock2.h>
#else #else
#include <time.h> #include <time.h>
@ -67,7 +67,7 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <signal.h> #include <signal.h>
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
#include <sys/file.h> #include <sys/file.h>
#include <sys/stat.h> #include <sys/stat.h>

View file

@ -2214,7 +2214,7 @@ GSAutoreleasedBuffer(unsigned size)
/* Getting a system error message on a variety of systems */ /* Getting a system error message on a variety of systems */
#ifdef __MINGW__ #ifdef __MINGW32__
LPTSTR GetErrorMsg(DWORD msgId) LPTSTR GetErrorMsg(DWORD msgId)
{ {
LPVOID lpMsgBuf; LPVOID lpMsgBuf;
@ -2244,12 +2244,12 @@ strerror(int eno)
return(sys_errlist[eno]); return(sys_errlist[eno]);
} }
#endif #endif
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
const char * const char *
GSLastErrorStr(long error_id) GSLastErrorStr(long error_id)
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
return GetErrorMsg(GetLastError()); return GetErrorMsg(GetLastError());
#else #else
return strerror(error_id); return strerror(error_id);

View file

@ -44,7 +44,7 @@
#include "../Tools/gdomap.h" #include "../Tools/gdomap.h"
#if defined(__MINGW__) #if defined(__MINGW32__)
#include <winsock2.h> #include <winsock2.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/file.h> #include <sys/file.h>
@ -71,7 +71,7 @@
#define SOCKET int #define SOCKET int
#define SOCKET_ERROR -1 #define SOCKET_ERROR -1
#define INVALID_SOCKET -1 #define INVALID_SOCKET -1
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
@ -133,7 +133,7 @@ static NSString* NotificationKey = @"NSFileHandleNotificationKey";
#endif #endif
if (isSocket) if (isSocket)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
len = recv((SOCKET)_get_osfhandle(descriptor), buf, len, 0); len = recv((SOCKET)_get_osfhandle(descriptor), buf, len, 0);
#else #else
len = recv(descriptor, buf, len, 0); len = recv(descriptor, buf, len, 0);
@ -161,7 +161,7 @@ static NSString* NotificationKey = @"NSFileHandleNotificationKey";
#endif #endif
if (isSocket) if (isSocket)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
len = send((SOCKET)_get_osfhandle(descriptor), buf, len, 0); len = send((SOCKET)_get_osfhandle(descriptor), buf, len, 0);
#else #else
len = send(descriptor, buf, len, 0); len = send(descriptor, buf, len, 0);
@ -302,7 +302,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
[self setNonBlocking: wasNonBlocking]; [self setNonBlocking: wasNonBlocking];
if (closeOnDealloc == YES) if (closeOnDealloc == YES)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (isSocket) if (isSocket)
{ {
closesocket((SOCKET)_get_osfhandle(descriptor)); closesocket((SOCKET)_get_osfhandle(descriptor));
@ -842,7 +842,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{ {
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(lsin.sin_addr), NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(lsin.sin_addr),
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
#if defined(__MINGW__) #if defined(__MINGW32__)
(void) closesocket(net); (void) closesocket(net);
#else #else
(void) close(net); (void) close(net);
@ -852,7 +852,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
self = [self initWithNativeHandle: (void*)net closeOnDealloc: YES]; self = [self initWithNativeHandle: (void*)net closeOnDealloc: YES];
#else #else
self = [self initWithFileDescriptor: net closeOnDealloc: YES]; self = [self initWithFileDescriptor: net closeOnDealloc: YES];
@ -865,7 +865,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
[self setNonBlocking: YES]; [self setNonBlocking: YES];
if (connect(net, (struct sockaddr*)&sin, sizeof(sin)) == SOCKET_ERROR) if (connect(net, (struct sockaddr*)&sin, sizeof(sin)) == SOCKET_ERROR)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (WSAGetLastError() != WSAEWOULDBLOCK) if (WSAGetLastError() != WSAEWOULDBLOCK)
#else #else
if (errno != EINPROGRESS) if (errno != EINPROGRESS)
@ -956,7 +956,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{ {
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr), NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr),
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno)); GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
#if defined(__MINGW__) #if defined(__MINGW32__)
(void) closesocket(net); (void) closesocket(net);
#else #else
(void) close(net); (void) close(net);
@ -968,7 +968,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
if (listen(net, 5) == SOCKET_ERROR) if (listen(net, 5) == SOCKET_ERROR)
{ {
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno)); NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
#if defined(__MINGW__) #if defined(__MINGW32__)
(void) closesocket(net); (void) closesocket(net);
#else #else
(void) close(net); (void) close(net);
@ -980,7 +980,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
if (getsockname(net, (struct sockaddr*)&sin, &size) == SOCKET_ERROR) if (getsockname(net, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
{ {
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno)); NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
#if defined(__MINGW__) #if defined(__MINGW32__)
(void) closesocket(net); (void) closesocket(net);
#else #else
(void) close(net); (void) close(net);
@ -989,7 +989,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
return nil; return nil;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
self = [self initWithNativeHandle: (void*)net closeOnDealloc: YES]; self = [self initWithNativeHandle: (void*)net closeOnDealloc: YES];
#else #else
self = [self initWithFileDescriptor: net closeOnDealloc: YES]; self = [self initWithFileDescriptor: net closeOnDealloc: YES];
@ -1008,7 +1008,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (id) initForReadingAtPath: (NSString*)path - (id) initForReadingAtPath: (NSString*)path
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
int d = _wopen( int d = _wopen(
(unichar*)[path cStringUsingEncoding: NSUnicodeStringEncoding], (unichar*)[path cStringUsingEncoding: NSUnicodeStringEncoding],
O_RDONLY|O_BINARY); O_RDONLY|O_BINARY);
@ -1036,7 +1036,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (id) initForWritingAtPath: (NSString*)path - (id) initForWritingAtPath: (NSString*)path
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
int d = _wopen( int d = _wopen(
(unichar*)[path cStringUsingEncoding: NSUnicodeStringEncoding], (unichar*)[path cStringUsingEncoding: NSUnicodeStringEncoding],
O_WRONLY|O_BINARY); O_WRONLY|O_BINARY);
@ -1064,7 +1064,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (id) initForUpdatingAtPath: (NSString*)path - (id) initForUpdatingAtPath: (NSString*)path
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
int d = _wopen( int d = _wopen(
(unichar*)[path cStringUsingEncoding: NSUnicodeStringEncoding], (unichar*)[path cStringUsingEncoding: NSUnicodeStringEncoding],
O_RDWR|O_BINARY); O_RDWR|O_BINARY);
@ -1151,7 +1151,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (id) initWithNullDevice - (id) initWithNullDevice
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
isNullDevice = YES; isNullDevice = YES;
isStandardFile = YES; isStandardFile = YES;
descriptor = -1; descriptor = -1;
@ -1171,14 +1171,14 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
self = [super init]; self = [super init];
if (self != nil) if (self != nil)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
struct _stat sbuf; struct _stat sbuf;
#else #else
struct stat sbuf; struct stat sbuf;
int e; int e;
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
if (_fstat(desc, &sbuf) != 0) if (_fstat(desc, &sbuf) != 0)
#else #else
if (fstat(desc, &sbuf) < 0) if (fstat(desc, &sbuf) < 0)
@ -1199,7 +1199,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
if (isStandardFile == NO) if (isStandardFile == NO)
{ {
unsigned long nbio = 0; unsigned long nbio = 0;
@ -1243,7 +1243,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
writeOK = YES; writeOK = YES;
acceptOK = YES; acceptOK = YES;
connectOK = YES; connectOK = YES;
#if defined(__MINGW__) #if defined(__MINGW32__)
if (isSocket) if (isSocket)
{ {
event = CreateEvent(NULL, NO, NO, NULL); event = CreateEvent(NULL, NO, NO, NULL);
@ -1265,7 +1265,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (id) initWithNativeHandle: (void*)hdl - (id) initWithNativeHandle: (void*)hdl
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
return [self initWithFileDescriptor: _open_osfhandle((SOCKET)hdl, 0) return [self initWithFileDescriptor: _open_osfhandle((SOCKET)hdl, 0)
closeOnDealloc: NO]; closeOnDealloc: NO];
#else #else
@ -1275,7 +1275,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (id) initWithNativeHandle: (void*)hdl closeOnDealloc: (BOOL)flag - (id) initWithNativeHandle: (void*)hdl closeOnDealloc: (BOOL)flag
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
return [self initWithFileDescriptor: _open_osfhandle((SOCKET)hdl, 0) return [self initWithFileDescriptor: _open_osfhandle((SOCKET)hdl, 0)
closeOnDealloc: flag]; closeOnDealloc: flag];
#else #else
@ -1385,7 +1385,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (void*) nativeHandle - (void*) nativeHandle
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
return (void*)(SOCKET)_get_osfhandle(descriptor); return (void*)(SOCKET)_get_osfhandle(descriptor);
#else #else
return (void*)descriptor; return (void*)descriptor;
@ -1530,7 +1530,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
rval = [self write: (char*)ptr+pos length: toWrite]; rval = [self write: (char*)ptr+pos length: toWrite];
if (rval < 0) if (rval < 0)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (WSAGetLastError()== WSAEINTR || if (WSAGetLastError()== WSAEINTR ||
WSAGetLastError()== WSAEWOULDBLOCK) WSAGetLastError()== WSAEWOULDBLOCK)
#else #else
@ -1650,7 +1650,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
result = _lseek(descriptor, 0, SEEK_CUR); result = _lseek(descriptor, 0, SEEK_CUR);
#else #else
result = lseek(descriptor, 0, SEEK_CUR); result = lseek(descriptor, 0, SEEK_CUR);
@ -1678,7 +1678,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
result = _lseek(descriptor, 0, SEEK_END); result = _lseek(descriptor, 0, SEEK_END);
#else #else
result = lseek(descriptor, 0, SEEK_END); result = lseek(descriptor, 0, SEEK_END);
@ -1706,7 +1706,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
result = _lseek(descriptor, (off_t)pos, SEEK_SET); result = _lseek(descriptor, (off_t)pos, SEEK_SET);
#else #else
result = lseek(descriptor, (off_t)pos, SEEK_SET); result = lseek(descriptor, (off_t)pos, SEEK_SET);
@ -1741,7 +1741,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
gzDescriptor = 0; gzDescriptor = 0;
} }
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
if (isSocket) if (isSocket)
{ {
(void)closesocket((SOCKET)_get_osfhandle(descriptor)); (void)closesocket((SOCKET)_get_osfhandle(descriptor));
@ -1782,7 +1782,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{ {
if (isStandardFile) if (isStandardFile)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
(void)_commit(descriptor); (void)_commit(descriptor);
#else #else
(void)sync(); (void)sync();
@ -1792,7 +1792,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
- (void) truncateFileAtOffset: (unsigned long long)pos - (void) truncateFileAtOffset: (unsigned long long)pos
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
_chsize(descriptor, pos); _chsize(descriptor, pos);
#else #else
if (isStandardFile && descriptor >= 0) if (isStandardFile && descriptor >= 0)
@ -1926,7 +1926,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
for (i = 0; i < [modes count]; i++) for (i = 0; i < [modes count]; i++)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: [modes objectAtIndex: i] forMode: [modes objectAtIndex: i]
@ -1941,7 +1941,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: NSDefaultRunLoopMode forMode: NSDefaultRunLoopMode
@ -1980,7 +1980,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
for (i = 0; i < [modes count]; i++) for (i = 0; i < [modes count]; i++)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: [modes objectAtIndex: i] forMode: [modes objectAtIndex: i]
@ -1995,7 +1995,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: NSDefaultRunLoopMode forMode: NSDefaultRunLoopMode
@ -2026,7 +2026,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
for (i = 0; i < [modes count]; i++) for (i = 0; i < [modes count]; i++)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l addEvent: (void*)(gsaddr)event [l addEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
watcher: self watcher: self
@ -2042,7 +2042,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l addEvent: (void*)(gsaddr)event [l addEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
watcher: self watcher: self
@ -2077,7 +2077,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
for (i = 0; i < [modes count]; i++) for (i = 0; i < [modes count]; i++)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l addEvent: (void*)(gsaddr)event [l addEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
watcher: self watcher: self
@ -2092,7 +2092,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
[l addEvent: (void*)(gsaddr)event [l addEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
watcher: self watcher: self
@ -2115,14 +2115,14 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
if (operation == NSFileHandleConnectionAcceptedNotification) if (operation == NSFileHandleConnectionAcceptedNotification)
{ {
struct sockaddr_in buf; struct sockaddr_in buf;
#if defined(__MINGW__) #if defined(__MINGW32__)
SOCKET desc; SOCKET desc;
#else #else
int desc; int desc;
#endif #endif
unsigned int blen = sizeof(buf); unsigned int blen = sizeof(buf);
#if defined(__MINGW__) #if defined(__MINGW32__)
desc = accept((SOCKET)_get_osfhandle(descriptor), (struct sockaddr*)&buf, &blen); desc = accept((SOCKET)_get_osfhandle(descriptor), (struct sockaddr*)&buf, &blen);
#else #else
desc = accept(descriptor, (struct sockaddr*)&buf, &blen); desc = accept(descriptor, (struct sockaddr*)&buf, &blen);
@ -2149,7 +2149,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
setsockopt(desc, SOL_SOCKET, SO_KEEPALIVE, (char *)&status, setsockopt(desc, SOL_SOCKET, SO_KEEPALIVE, (char *)&status,
sizeof(status)); sizeof(status));
#if defined(__MINGW__) #if defined(__MINGW32__)
h = [[[self class] alloc] initWithNativeHandle: (void*)desc h = [[[self class] alloc] initWithNativeHandle: (void*)desc
closeOnDealloc: YES]; closeOnDealloc: YES];
#else #else
@ -2200,7 +2200,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else if (received < 0) else if (received < 0)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (WSAGetLastError() != WSAEINTR if (WSAGetLastError() != WSAEINTR
&& WSAGetLastError() != WSAEWOULDBLOCK) && WSAGetLastError() != WSAEWOULDBLOCK)
#else #else
@ -2240,7 +2240,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
int result; int result;
unsigned len = sizeof(result); unsigned len = sizeof(result);
#if defined(__MINGW__) #if defined(__MINGW32__)
if (getsockopt((SOCKET)_get_osfhandle(descriptor), SOL_SOCKET, SO_ERROR, if (getsockopt((SOCKET)_get_osfhandle(descriptor), SOL_SOCKET, SO_ERROR,
(char*)&result, &len) == 0 && result != 0) (char*)&result, &len) == 0 && result != 0)
#else #else
@ -2279,7 +2279,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
length: length-writePos]; length: length-writePos];
if (written <= 0) if (written <= 0)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (written < 0 && WSAGetLastError()!= WSAEINTR if (written < 0 && WSAGetLastError()!= WSAEINTR
&& WSAGetLastError()!= WSAEWOULDBLOCK) && WSAGetLastError()!= WSAEWOULDBLOCK)
#else #else
@ -2311,7 +2311,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
extra: (void*)extra extra: (void*)extra
forMode: (NSString*)mode forMode: (NSString*)mode
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
WSANETWORKEVENTS ocurredEvents; WSANETWORKEVENTS ocurredEvents;
#endif #endif
@ -2321,7 +2321,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{ {
[self setNonBlocking: YES]; [self setNonBlocking: YES];
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
if (WSAEnumNetworkEvents((SOCKET)_get_osfhandle(descriptor), if (WSAEnumNetworkEvents((SOCKET)_get_osfhandle(descriptor),
event, &ocurredEvents) == SOCKET_ERROR) event, &ocurredEvents) == SOCKET_ERROR)
{ {
@ -2425,7 +2425,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
unsigned long dummy; unsigned long dummy;
if (isSocket != YES) if (isSocket != YES)

View file

@ -284,7 +284,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
[[NSProcessInfo processInfo] processIdentifier]]; [[NSProcessInfo processInfo] processIdentifier]];
RETAIN(debugFile); RETAIN(debugFile);
#ifndef __MINGW__ #if !defined(__MINGW32__)
sslClass = [NSFileHandle sslClass]; sslClass = [NSFileHandle sslClass];
#endif #endif
} }

View file

@ -46,20 +46,20 @@
#include <unistd.h> /* for gethostname() */ #include <unistd.h> /* for gethostname() */
#endif #endif
#ifdef __MINGW__ #if defined(__MINGW32__)
#define close closesocket #define close closesocket
#else #else
#include <sys/param.h> /* for MAXHOSTNAMELEN */ #include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> /* for inet_ntoa() */ #include <arpa/inet.h> /* for inet_ntoa() */
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <string.h> /* for strchr() */ #include <string.h> /* for strchr() */
#include <ctype.h> /* for strchr() */ #include <ctype.h> /* for strchr() */
#include <fcntl.h> #include <fcntl.h>
#ifdef __MINGW__ #if defined(__MINGW32__)
#include <winsock2.h> #include <winsock2.h>
#include <wininet.h> #include <wininet.h>
#include <process.h> #include <process.h>
@ -96,7 +96,7 @@
#define SOCKET_ERROR -1 #define SOCKET_ERROR -1
#define INVALID_SOCKET -1 #define INVALID_SOCKET -1
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
/* /*
* Largest chunk of data possible in DO * Largest chunk of data possible in DO
@ -390,18 +390,18 @@ static Class runLoopClass;
+ (GSTcpHandle*) handleWithDescriptor: (SOCKET)d + (GSTcpHandle*) handleWithDescriptor: (SOCKET)d
{ {
GSTcpHandle *handle; GSTcpHandle *handle;
#ifdef __MINGW__ #if defined(__MINGW32__)
unsigned long dummy; unsigned long dummy;
#else #else
int e; int e;
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
if (d == INVALID_SOCKET) if (d == INVALID_SOCKET)
{ {
NSLog(@"illegal descriptor (%d) for Tcp Handle", d); NSLog(@"illegal descriptor (%d) for Tcp Handle", d);
return nil; return nil;
} }
#ifdef __MINGW__ #if defined(__MINGW32__)
dummy = 1; dummy = 1;
if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR) if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR)
{ {
@ -409,7 +409,7 @@ static Class runLoopClass;
d, GSLastErrorStr(errno)); d, GSLastErrorStr(errno));
return nil; return nil;
} }
#else /* !__MINGW__ */ #else /* !__MINGW32__ */
if ((e = fcntl(d, F_GETFL, 0)) >= 0) if ((e = fcntl(d, F_GETFL, 0)) >= 0)
{ {
e |= NBLK_OPT; e |= NBLK_OPT;
@ -439,7 +439,7 @@ static Class runLoopClass;
{ {
if (self == [GSTcpHandle class]) if (self == [GSTcpHandle class])
{ {
#ifdef __MINGW__ #if defined(__MINGW32__)
WORD wVersionRequested; WORD wVersionRequested;
WSADATA wsaData; WSADATA wsaData;
@ -540,7 +540,7 @@ static Class runLoopClass;
if (connect(desc, (struct sockaddr*)&sockAddr, sizeof(sockAddr)) if (connect(desc, (struct sockaddr*)&sockAddr, sizeof(sockAddr))
== SOCKET_ERROR) == SOCKET_ERROR)
{ {
#ifdef __MINGW__ #if defined(__MINGW32__)
if (WSAGetLastError() != WSAEWOULDBLOCK) if (WSAGetLastError() != WSAEWOULDBLOCK)
#else #else
if (errno != EINPROGRESS) if (errno != EINPROGRESS)

View file

@ -374,7 +374,7 @@ _find_framework(NSString *name)
bundlePath = [bundlePath stringByDeletingLastPathComponent]; bundlePath = [bundlePath stringByDeletingLastPathComponent];
} }
/* There are no Versions on MinGW. Skip the Versions check here. */ /* There are no Versions on MinGW. Skip the Versions check here. */
#if !defined(__MINGW__) #if !defined(__MINGW32__)
/* version name */ /* version name */
bundlePath = [bundlePath stringByDeletingLastPathComponent]; bundlePath = [bundlePath stringByDeletingLastPathComponent];
@ -393,7 +393,7 @@ _find_framework(NSString *name)
if (bundlePath) if (bundlePath)
bundle = [[self alloc] initWithPath: bundlePath]; bundle = [[self alloc] initWithPath: bundlePath];
} }
#if !defined(__MINGW__) #if !defined(__MINGW32__)
} }
#endif #endif
@ -1586,7 +1586,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
mangledName = [mangledName stringByReplacingString: @"+" mangledName = [mangledName stringByReplacingString: @"+"
withString: @"_1"]; withString: @"_1"];
#if !defined(__MINGW__) #if !defined(__MINGW32__)
path = [_path stringByAppendingPathComponent:@"Versions/Current"]; path = [_path stringByAppendingPathComponent:@"Versions/Current"];
#else #else
path = _path; path = _path;
@ -1614,7 +1614,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
if (_bundleType == NSBUNDLE_FRAMEWORK) if (_bundleType == NSBUNDLE_FRAMEWORK)
{ {
#if !defined(__MINGW__) #if !defined(__MINGW32__)
return [_path stringByAppendingPathComponent: return [_path stringByAppendingPathComponent:
[NSString stringWithFormat:@"Versions/%@/Resources", [NSString stringWithFormat:@"Versions/%@/Resources",
version]]; version]];
@ -1665,7 +1665,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
if (_bundleType == NSBUNDLE_FRAMEWORK) if (_bundleType == NSBUNDLE_FRAMEWORK)
{ {
#if !defined(__MINGW__) #if !defined(__MINGW32__)
return [_path stringByAppendingPathComponent: return [_path stringByAppendingPathComponent:
[NSString stringWithFormat:@"Versions/%@/PlugIns", [NSString stringWithFormat:@"Versions/%@/PlugIns",
version]]; version]];
@ -1757,7 +1757,7 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
{ {
pathlist = [env objectForKey:@"Path"]; pathlist = [env objectForKey:@"Path"];
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
patharr = [pathlist componentsSeparatedByString:@";"]; patharr = [pathlist componentsSeparatedByString:@";"];
#else #else
patharr = [pathlist componentsSeparatedByString:@":"]; patharr = [pathlist componentsSeparatedByString:@":"];

View file

@ -1015,7 +1015,7 @@ static NSLock *cached_proxies_gate = nil;
/* /*
* Make sure we are not registered. * Make sure we are not registered.
*/ */
#ifndef __MINGW__ #if !defined(__MINGW32__)
if ([_receivePort isKindOfClass: [NSMessagePort class]]) if ([_receivePort isKindOfClass: [NSMessagePort class]])
{ {
[self registerName: nil [self registerName: nil

View file

@ -64,7 +64,7 @@
* *
*/ */
#if defined(__MINGW__) #if defined(__MINGW32__)
#define UNICODE #define UNICODE
#define _UNICODE #define _UNICODE
#endif #endif
@ -132,7 +132,7 @@ static IMP appendImp;
static BOOL static BOOL
readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone) readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
const unichar *thePath = 0; const unichar *thePath = 0;
#else #else
const char *thePath = 0; const char *thePath = 0;
@ -146,7 +146,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
zone = GSAtomicMallocZone(); // Use non-GC memory inside NSData zone = GSAtomicMallocZone(); // Use non-GC memory inside NSData
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
thePath = (const unichar*)[path fileSystemRepresentation]; thePath = (const unichar*)[path fileSystemRepresentation];
#else #else
thePath = [path fileSystemRepresentation]; thePath = [path fileSystemRepresentation];
@ -157,7 +157,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
return NO; return NO;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
theFile = _wfopen(thePath, L"rb"); theFile = _wfopen(thePath, L"rb");
#else #else
theFile = fopen(thePath, "rb"); theFile = fopen(thePath, "rb");
@ -819,7 +819,7 @@ static unsigned gsu32Align;
*/ */
- (BOOL) writeToFile: (NSString*)path atomically: (BOOL)useAuxiliaryFile - (BOOL) writeToFile: (NSString*)path atomically: (BOOL)useAuxiliaryFile
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
unsigned int length = [path length]; unsigned int length = [path length];
unichar wthePath[length + 100]; unichar wthePath[length + 100];
unichar wtheRealPath[length + 100]; unichar wtheRealPath[length + 100];
@ -831,7 +831,7 @@ static unsigned gsu32Align;
FILE *theFile; FILE *theFile;
BOOL error_BadPath = YES; BOOL error_BadPath = YES;
#if defined(__MINGW__) #if defined(__MINGW32__)
[path getCharacters: wtheRealPath]; [path getCharacters: wtheRealPath];
wtheRealPath[length] = L'\0'; wtheRealPath[length] = L'\0';
error_BadPath = (length <= 0); error_BadPath = (length <= 0);
@ -886,7 +886,7 @@ static unsigned gsu32Align;
/* Use the path name of the destination file as a prefix for the /* Use the path name of the destination file as a prefix for the
* mktemp() call so that we can be sure that both files are on * mktemp() call so that we can be sure that both files are on
* the same filesystem and the subsequent rename() will work. */ * the same filesystem and the subsequent rename() will work. */
#if defined(__MINGW__) #if defined(__MINGW32__)
wcscpy(wthePath, wtheRealPath); wcscpy(wthePath, wtheRealPath);
wcscat(wthePath, L"XXXXXX"); wcscat(wthePath, L"XXXXXX");
if (_wmktemp(wthePath) == 0) if (_wmktemp(wthePath) == 0)
@ -909,7 +909,7 @@ static unsigned gsu32Align;
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
wcscpy(wthePath,wtheRealPath); wcscpy(wthePath,wtheRealPath);
#else #else
strcpy(thePath, theRealPath); strcpy(thePath, theRealPath);
@ -917,7 +917,7 @@ static unsigned gsu32Align;
} }
/* Open the file (whether temp or real) for writing. */ /* Open the file (whether temp or real) for writing. */
#if defined(__MINGW__) #if defined(__MINGW32__)
theFile = _wfopen(wthePath, L"wb"); theFile = _wfopen(wthePath, L"wb");
#else #else
theFile = fopen(thePath, "wb"); theFile = fopen(thePath, "wb");
@ -928,7 +928,7 @@ static unsigned gsu32Align;
{ {
/* Something went wrong; we weren't /* Something went wrong; we weren't
* even able to open the file. */ * even able to open the file. */
#if defined(__MINGW__) #if defined(__MINGW32__)
NSWarnMLog(@"Open (%@) failed - %s", NSWarnMLog(@"Open (%@) failed - %s",
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)], [NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
GSLastErrorStr(errno)); GSLastErrorStr(errno));
@ -946,7 +946,7 @@ static unsigned gsu32Align;
if (c < (int)[self length]) /* We failed to write everything for if (c < (int)[self length]) /* We failed to write everything for
* some reason. */ * some reason. */
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
NSWarnMLog(@"Fwrite (%@) failed - %s", NSWarnMLog(@"Fwrite (%@) failed - %s",
[NSString stringWithCharacters:wthePath length:wcslen(wthePath)], [NSString stringWithCharacters:wthePath length:wcslen(wthePath)],
GSLastErrorStr(errno)); GSLastErrorStr(errno));
@ -963,7 +963,7 @@ static unsigned gsu32Align;
* closing the file, but we got here, * closing the file, but we got here,
* so we need to deal with it. */ * so we need to deal with it. */
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
NSWarnMLog(@"Fclose (%@) failed - %s", NSWarnMLog(@"Fclose (%@) failed - %s",
[NSString stringWithCharacters:wthePath length:wcslen(wthePath)], [NSString stringWithCharacters:wthePath length:wcslen(wthePath)],
GSLastErrorStr(errno)); GSLastErrorStr(errno));
@ -988,7 +988,7 @@ static unsigned gsu32Align;
IF_NO_GC(TEST_AUTORELEASE(att)); IF_NO_GC(TEST_AUTORELEASE(att));
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
/* /*
* The windoze implementation of the POSIX rename() function is buggy * The windoze implementation of the POSIX rename() function is buggy
* and doesn't work if the destination file already exists ... so we * and doesn't work if the destination file already exists ... so we
@ -1048,7 +1048,7 @@ static unsigned gsu32Align;
#endif #endif
if (c != 0) /* Many things could go wrong, I guess. */ if (c != 0) /* Many things could go wrong, I guess. */
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
NSWarnMLog(@"Rename ('%@' to '%@') failed - %s", NSWarnMLog(@"Rename ('%@' to '%@') failed - %s",
[NSString stringWithCharacters: wthePath length:wcslen(wthePath)], [NSString stringWithCharacters: wthePath length:wcslen(wthePath)],
[NSString stringWithCharacters: [NSString stringWithCharacters:
@ -1080,7 +1080,7 @@ static unsigned gsu32Align;
path); path);
} }
} }
#ifndef __MINGW__ #ifndef __MINGW32__
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO) else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
{ {
att = [NSDictionary dictionaryWithObjectsAndKeys: att = [NSDictionary dictionaryWithObjectsAndKeys:
@ -1103,7 +1103,7 @@ failure:
*/ */
if (useAuxiliaryFile) if (useAuxiliaryFile)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
_wunlink(wthePath); _wunlink(wthePath);
#else #else
unlink(thePath); unlink(thePath);
@ -2886,7 +2886,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
{ {
int fd; int fd;
#if defined(__MINGW__) #if defined(__MINGW32__)
const unichar *thePath = (const unichar*)[path filesystemRepresentation]; const unichar *thePath = (const unichar*)[path filesystemRepresentation];
#else #else
const char *thePath = [path fileSystemRepresentation]; const char *thePath = [path fileSystemRepresentation];
@ -2899,7 +2899,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
return nil; return nil;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
fd = _wopen(thePath, _O_RDONLY); fd = _wopen(thePath, _O_RDONLY);
#else #else
fd = open(thePath, O_RDONLY); fd = open(thePath, O_RDONLY);

View file

@ -125,7 +125,7 @@ otherTime(NSDate* other)
NSTimeInterval NSTimeInterval
GSTimeNow(void) GSTimeNow(void)
{ {
#if !defined(__MINGW__) #if !defined(__MINGW32__)
NSTimeInterval interval; NSTimeInterval interval;
struct timeval tp; struct timeval tp;
@ -163,7 +163,7 @@ GSTimeNow(void)
sys_time.wMinute, sys_time.wSecond, sys_time.wMilliseconds); sys_time.wMinute, sys_time.wSecond, sys_time.wMilliseconds);
#endif #endif
return t; return t;
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
} }
/** /**

View file

@ -584,7 +584,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
NSString *description = nil; NSString *description = nil;
NSPortNameServer *ns = nil; NSPortNameServer *ns = nil;
#ifdef __MINGW__ #ifdef __MINGW32__
if (_type == NSLocalNotificationCenterType) if (_type == NSLocalNotificationCenterType)
{ {
ASSIGN(_type, GSPublicNotificationCenterType); ASSIGN(_type, GSPublicNotificationCenterType);

View file

@ -38,7 +38,7 @@
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
#if defined(__MINGW__) #if defined(__MINGW32__)
#define UNICODE #define UNICODE
#define _UNICODE #define _UNICODE
#endif #endif
@ -77,7 +77,7 @@
# include <windows.h> # include <windows.h>
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
#include <stdio.h> #include <stdio.h>
#ifdef UNICODE #ifdef UNICODE
#include <wchar.h> #include <wchar.h>
@ -89,7 +89,7 @@
#if defined(_POSIX_VERSION) || defined(__WIN32__) #if defined(_POSIX_VERSION) || defined(__WIN32__)
# include <limits.h> /* for PATH_MAX */ # include <limits.h> /* for PATH_MAX */
# if defined(__MINGW__) # if defined(__MINGW32__)
# include <sys/utime.h> # include <sys/utime.h>
# else # else
# include <utime.h> # include <utime.h>
@ -183,7 +183,7 @@
* Macros to handle unichar filesystem support. * Macros to handle unichar filesystem support.
*/ */
#if defined(__MINGW__) && defined(UNICODE) #if defined(__MINGW32__) && defined(UNICODE)
#define _CHMOD(A,B) _wchmod(A,B) #define _CHMOD(A,B) _wchmod(A,B)
#define _CLOSEDIR(A) _wclosedir(A) #define _CLOSEDIR(A) _wclosedir(A)
@ -356,7 +356,7 @@ static NSStringEncoding defaultEncoding;
- (BOOL) changeCurrentDirectoryPath: (NSString*)path - (BOOL) changeCurrentDirectoryPath: (NSString*)path
{ {
const _CHAR *lpath = (_CCP)[self fileSystemRepresentationWithPath: path]; const _CHAR *lpath = (_CCP)[self fileSystemRepresentationWithPath: path];
#if defined(__MINGW__) #if defined(__MINGW32__)
return SetCurrentDirectory(lpath) == TRUE ? YES : NO; return SetCurrentDirectory(lpath) == TRUE ? YES : NO;
#else #else
return (chdir(lpath) == 0) ? YES : NO; return (chdir(lpath) == 0) ? YES : NO;
@ -383,7 +383,7 @@ static NSStringEncoding defaultEncoding;
} }
lpath = (_CCP)[defaultManager fileSystemRepresentationWithPath: path]; lpath = (_CCP)[defaultManager fileSystemRepresentationWithPath: path];
#ifndef __MINGW__ #ifndef __MINGW32__
num = [attributes fileOwnerAccountID]; num = [attributes fileOwnerAccountID];
if (num != NSNotFound) if (num != NSNotFound)
{ {
@ -456,7 +456,7 @@ static NSStringEncoding defaultEncoding;
ASSIGN(_lastError, str); ASSIGN(_lastError, str);
} }
} }
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
num = [attributes filePosixPermissions]; num = [attributes filePosixPermissions];
if (num != NSNotFound) if (num != NSNotFound)
@ -628,7 +628,7 @@ static NSStringEncoding defaultEncoding;
- (BOOL) createDirectoryAtPath: (NSString*)path - (BOOL) createDirectoryAtPath: (NSString*)path
attributes: (NSDictionary*)attributes attributes: (NSDictionary*)attributes
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
NSEnumerator *paths = [[path pathComponents] objectEnumerator]; NSEnumerator *paths = [[path pathComponents] objectEnumerator];
NSString *subPath; NSString *subPath;
NSString *completePath = nil; NSString *completePath = nil;
@ -644,7 +644,7 @@ static NSStringEncoding defaultEncoding;
if ([path length] == 0) if ([path length] == 0)
return NO; return NO;
#if defined(__MINGW__) #if defined(__MINGW32__)
while ((subPath = [paths nextObject])) while ((subPath = [paths nextObject]))
{ {
BOOL isDir = NO; BOOL isDir = NO;
@ -786,7 +786,7 @@ static NSStringEncoding defaultEncoding;
contents: (NSData*)contents contents: (NSData*)contents
attributes: (NSDictionary*)attributes attributes: (NSDictionary*)attributes
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
const _CHAR *lpath = (_CCP)[self fileSystemRepresentationWithPath: path]; const _CHAR *lpath = (_CCP)[self fileSystemRepresentationWithPath: path];
HANDLE fh; HANDLE fh;
DWORD written = 0; DWORD written = 0;
@ -802,7 +802,7 @@ static NSStringEncoding defaultEncoding;
if ([path length] == 0) if ([path length] == 0)
return NO; return NO;
#if defined(__MINGW__) #if defined(__MINGW32__)
fh = CreateFile(lpath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, fh = CreateFile(lpath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, 0); FILE_ATTRIBUTE_NORMAL, 0);
if (fh == INVALID_HANDLE_VALUE) if (fh == INVALID_HANDLE_VALUE)
@ -878,7 +878,7 @@ static NSStringEncoding defaultEncoding;
{ {
NSString *currentDir = nil; NSString *currentDir = nil;
#if defined(__MINGW__) #if defined(__MINGW32__)
int len = GetCurrentDirectory(0, 0); int len = GetCurrentDirectory(0, 0);
if (len > 0) if (len > 0)
{ {
@ -1223,7 +1223,7 @@ static NSStringEncoding defaultEncoding;
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
DWORD res; DWORD res;
res = GetFileAttributes(lpath); res = GetFileAttributes(lpath);
@ -1253,7 +1253,7 @@ static NSStringEncoding defaultEncoding;
if (!is_dir) if (!is_dir)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (DeleteFile(lpath) == FALSE) if (DeleteFile(lpath) == FALSE)
#else #else
if (unlink(lpath) < 0) if (unlink(lpath) < 0)
@ -1332,7 +1332,7 @@ static NSStringEncoding defaultEncoding;
return NO; return NO;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
{ {
DWORD res; DWORD res;
@ -1386,7 +1386,7 @@ static NSStringEncoding defaultEncoding;
return NO; return NO;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
{ {
DWORD res; DWORD res;
@ -1422,7 +1422,7 @@ static NSStringEncoding defaultEncoding;
return NO; return NO;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
{ {
DWORD res; DWORD res;
@ -1463,7 +1463,7 @@ static NSStringEncoding defaultEncoding;
return NO; return NO;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
{ {
DWORD res; DWORD res;
@ -1509,7 +1509,7 @@ static NSStringEncoding defaultEncoding;
return NO; return NO;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
// TODO - handle directories // TODO - handle directories
{ {
DWORD res; DWORD res;
@ -1641,7 +1641,7 @@ static NSStringEncoding defaultEncoding;
*/ */
- (NSDictionary*) fileSystemAttributesAtPath: (NSString*)path - (NSDictionary*) fileSystemAttributesAtPath: (NSString*)path
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
unsigned long long totalsize, freesize; unsigned long long totalsize, freesize;
id values[5]; id values[5];
id keys[5] = { id keys[5] = {
@ -1899,7 +1899,7 @@ static NSStringEncoding defaultEncoding;
if (path != nil) if (path != nil)
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
c_path = (_CCP)[path cStringUsingEncoding: NSUnicodeStringEncoding]; c_path = (_CCP)[path cStringUsingEncoding: NSUnicodeStringEncoding];
#else #else
c_path = (_CCP)[path cStringUsingEncoding: defaultEncoding]; c_path = (_CCP)[path cStringUsingEncoding: defaultEncoding];
@ -1926,7 +1926,7 @@ static NSStringEncoding defaultEncoding;
- (NSString*) stringWithFileSystemRepresentation: (const char*)string - (NSString*) stringWithFileSystemRepresentation: (const char*)string
length: (unsigned int)len length: (unsigned int)len
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
return [NSString stringWithCharacters: (const unichar*)string length: len/2]; return [NSString stringWithCharacters: (const unichar*)string length: len/2];
#else #else
return AUTORELEASE([[NSString allocWithZone: NSDefaultMallocZone()] return AUTORELEASE([[NSString allocWithZone: NSDefaultMallocZone()]
@ -2131,7 +2131,7 @@ inline void gsedRelease(GSEnumeratedDirectory X)
if (dirbuf) if (dirbuf)
{ {
#if defined(__MINGW__) && defined(UNICODE) #if defined(__MINGW32__) && defined(UNICODE)
/* Skip "." and ".." directory entries */ /* Skip "." and ".." directory entries */
if (wcscmp(dirbuf->d_name, L".") == 0 if (wcscmp(dirbuf->d_name, L".") == 0
|| wcscmp(dirbuf->d_name, L"..") == 0) || wcscmp(dirbuf->d_name, L"..") == 0)
@ -2167,7 +2167,7 @@ inline void gsedRelease(GSEnumeratedDirectory X)
{ {
// Do not follow links // Do not follow links
#ifdef S_IFLNK #ifdef S_IFLNK
#ifdef __MINGW__ #ifdef __MINGW32__
#warning "lstat does not support unichars" #warning "lstat does not support unichars"
#else #else
if (!_flags.isFollowing) if (!_flags.isFollowing)
@ -2414,7 +2414,7 @@ inline void gsedRelease(GSEnumeratedDirectory X)
toFile: (NSString*)destination toFile: (NSString*)destination
handler: (id)handler handler: (id)handler
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (CopyFile((_CCP)[self fileSystemRepresentationWithPath: source], if (CopyFile((_CCP)[self fileSystemRepresentationWithPath: source],
(_CCP)[self fileSystemRepresentationWithPath: destination], NO)) (_CCP)[self fileSystemRepresentationWithPath: destination], NO))
{ {
@ -2758,7 +2758,7 @@ static NSSet *fileKeys = nil;
} }
d = (GSAttrDictionary*)NSAllocateObject(self, 0, NSDefaultMallocZone()); d = (GSAttrDictionary*)NSAllocateObject(self, 0, NSDefaultMallocZone());
#if defined(S_IFLNK) && !defined(__MINGW__) #if defined(S_IFLNK) && !defined(__MINGW32__)
if (traverse == NO) if (traverse == NO)
{ {
if (lstat(lpath, &d->statbuf) != 0) if (lstat(lpath, &d->statbuf) != 0)

View file

@ -37,7 +37,7 @@
#include "Foundation/NSCoder.h" #include "Foundation/NSCoder.h"
#include "Foundation/NSDebug.h" #include "Foundation/NSDebug.h"
#if defined(__MINGW__) #if defined(__MINGW32__)
#include <winsock2.h> #include <winsock2.h>
#else #else
#include <netdb.h> #include <netdb.h>
@ -48,7 +48,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#endif /* !__MINGW__*/ #endif /* !__MINGW32__*/
#ifndef INADDR_NONE #ifndef INADDR_NONE
#define INADDR_NONE -1 #define INADDR_NONE -1

View file

@ -276,7 +276,7 @@ NSLogv (NSString* format, va_list args)
if (_NSLog_printf_handler == NULL) if (_NSLog_printf_handler == NULL)
_NSLog_printf_handler = *_NSLog_standard_printf_handler; _NSLog_printf_handler = *_NSLog_standard_printf_handler;
#if defined(__MINGW__) #if defined(__MINGW32__)
pid = (int)GetCurrentProcessId(); pid = (int)GetCurrentProcessId();
#else #else
pid = (int)getpid(); pid = (int)getpid();

View file

@ -48,18 +48,18 @@
#include <unistd.h> /* for gethostname() */ #include <unistd.h> /* for gethostname() */
#endif #endif
#ifndef __MINGW__ #ifndef __MINGW32__
#include <sys/param.h> /* for MAXHOSTNAMELEN */ #include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/types.h> #include <sys/types.h>
#include <sys/un.h> #include <sys/un.h>
#include <arpa/inet.h> /* for inet_ntoa() */ #include <arpa/inet.h> /* for inet_ntoa() */
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <string.h> /* for strchr() */ #include <string.h> /* for strchr() */
#include <ctype.h> /* for strchr() */ #include <ctype.h> /* for strchr() */
#include <fcntl.h> #include <fcntl.h>
#ifdef __MINGW__ #ifdef __MINGW32__
#include <winsock2.h> #include <winsock2.h>
#include <wininet.h> #include <wininet.h>
#include <process.h> #include <process.h>
@ -92,9 +92,9 @@
#if defined(__svr4__) #if defined(__svr4__)
#include <sys/stropts.h> #include <sys/stropts.h>
#endif #endif
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
#ifdef __MINGW__ #ifdef __MINGW32__
#define close closesocket #define close closesocket
#endif #endif
@ -305,18 +305,18 @@ static Class runLoopClass;
+ (GSMessageHandle*) handleWithDescriptor: (int)d + (GSMessageHandle*) handleWithDescriptor: (int)d
{ {
GSMessageHandle *handle; GSMessageHandle *handle;
#ifdef __MINGW__ #ifdef __MINGW32__
unsigned long dummy; unsigned long dummy;
#else #else
int e; int e;
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
if (d < 0) if (d < 0)
{ {
NSLog(@"illegal descriptor (%d) for message handle", d); NSLog(@"illegal descriptor (%d) for message handle", d);
return nil; return nil;
} }
#ifdef __MINGW__ #ifdef __MINGW32__
dummy = 1; dummy = 1;
if (ioctlsocket(d, FIONBIO, &dummy) < 0) if (ioctlsocket(d, FIONBIO, &dummy) < 0)
{ {
@ -324,7 +324,7 @@ static Class runLoopClass;
d, GSLastErrorStr(errno)); d, GSLastErrorStr(errno));
return nil; return nil;
} }
#else /* !__MINGW__ */ #else /* !__MINGW32__ */
if ((e = fcntl(d, F_GETFL, 0)) >= 0) if ((e = fcntl(d, F_GETFL, 0)) >= 0)
{ {
e |= NBLK_OPT; e |= NBLK_OPT;
@ -354,7 +354,7 @@ static Class runLoopClass;
{ {
if (self == [GSMessageHandle class]) if (self == [GSMessageHandle class])
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
WORD wVersionRequested; WORD wVersionRequested;
WSADATA wsaData; WSADATA wsaData;
@ -413,7 +413,7 @@ static Class runLoopClass;
if (connect(desc, (struct sockaddr*)&sockAddr, SUN_LEN(&sockAddr)) < 0) if (connect(desc, (struct sockaddr*)&sockAddr, SUN_LEN(&sockAddr)) < 0)
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
if (WSAGetLastError() != WSAEWOULDBLOCK) if (WSAGetLastError() != WSAEWOULDBLOCK)
#else #else
if (errno != EINPROGRESS) if (errno != EINPROGRESS)
@ -618,7 +618,7 @@ static Class runLoopClass;
* Now try to fill the buffer with data. * Now try to fill the buffer with data.
*/ */
bytes = [rData mutableBytes]; bytes = [rData mutableBytes];
#ifdef __MINGW__ #ifdef __MINGW32__
res = recv(desc, bytes + rLength, want - rLength, 0); res = recv(desc, bytes + rLength, want - rLength, 0);
#else #else
res = read(desc, bytes + rLength, want - rLength); res = read(desc, bytes + rLength, want - rLength);
@ -940,7 +940,7 @@ static Class runLoopClass;
{ {
NSData *d = newDataWithEncodedPort([self recvPort]); NSData *d = newDataWithEncodedPort([self recvPort]);
#ifdef __MINGW__ #ifdef __MINGW32__
len = send(desc, [d bytes], [d length], 0); len = send(desc, [d bytes], [d length], 0);
#else #else
len = write(desc, [d bytes], [d length]); len = write(desc, [d bytes], [d length]);
@ -984,7 +984,7 @@ static Class runLoopClass;
} }
b = [wData bytes]; b = [wData bytes];
l = [wData length]; l = [wData length];
#ifdef __MINGW__ #ifdef __MINGW32__
res = send(desc, b + wLength, l - wLength, 0); res = send(desc, b + wLength, l - wLength, 0);
#else #else
res = write(desc, b + wLength, l - wLength); res = write(desc, b + wLength, l - wLength);

View file

@ -881,7 +881,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
{ {
extern void GSBuildStrings(void); // See externs.m extern void GSBuildStrings(void); // See externs.m
#ifdef __MINGW__ #ifdef __MINGW32__
// See libgnustep-base-entry.m // See libgnustep-base-entry.m
extern void gnustep_base_socket_init(void); extern void gnustep_base_socket_init(void);
gnustep_base_socket_init(); gnustep_base_socket_init();

View file

@ -49,7 +49,7 @@
#include <malloc.h> #include <malloc.h>
#endif #endif
#ifdef __MINGW__ #ifdef __MINGW32__
#include <malloc.h> #include <malloc.h>
static size_t static size_t
getpagesize(void) getpagesize(void)
@ -146,7 +146,7 @@ NSRealMemoryAvailable ()
if ((sysinfo(&info)) != 0) if ((sysinfo(&info)) != 0)
return 0; return 0;
return (unsigned) info.freeram; return (unsigned) info.freeram;
#elif defined(__MINGW__) #elif defined(__MINGW32__)
MEMORYSTATUS memory; MEMORYSTATUS memory;
GlobalMemoryStatus(&memory); GlobalMemoryStatus(&memory);

View file

@ -803,7 +803,7 @@ NSString *
NSHomeDirectoryForUser(NSString *loginName) NSHomeDirectoryForUser(NSString *loginName)
{ {
NSString *s = nil; NSString *s = nil;
#if !defined(__MINGW__) #if !defined(__MINGW32__)
struct passwd *pw; struct passwd *pw;
[gnustep_global_lock lock]; [gnustep_global_lock lock];
@ -1048,7 +1048,7 @@ NSTemporaryDirectory(void)
baseTempDirName = [env objectForKey: @"TMP"]; baseTempDirName = [env objectForKey: @"TMP"];
if (baseTempDirName == nil) if (baseTempDirName == nil)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
#ifdef __CYGWIN__ #ifdef __CYGWIN__
baseTempDirName = @"/cygdrive/c/"; baseTempDirName = @"/cygdrive/c/";
#else #else
@ -1087,9 +1087,9 @@ NSTemporaryDirectory(void)
perm = perm & 0777; perm = perm & 0777;
// Mateu Batle: secure temporary directories don't work in MinGW // Mateu Batle: secure temporary directories don't work in MinGW
#ifndef __MINGW__ #ifndef __MINGW32__
#if defined(__MINGW__) #if defined(__MINGW32__)
uid = owner; uid = owner;
#else #else
#ifdef HAVE_GETEUID #ifdef HAVE_GETEUID
@ -1176,7 +1176,7 @@ NSOpenStepRootDirectory(void)
objectForKey: @"GNUSTEP_ROOT"]; objectForKey: @"GNUSTEP_ROOT"];
if (root == nil) if (root == nil)
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
#ifdef __CYGWIN__ #ifdef __CYGWIN__
root = @"/cygdrive/c/"; root = @"/cygdrive/c/";
#else #else

View file

@ -65,7 +65,7 @@
self = [super init]; self = [super init];
if (self != nil) if (self != nil)
{ {
#ifndef __MINGW__ #ifndef __MINGW32__
int p[2]; int p[2];
if (pipe(p) == 0) if (pipe(p) == 0)

View file

@ -67,7 +67,7 @@ Class NSPort_concrete_class;
if (self == [NSPort class]) if (self == [NSPort class])
{ {
NSPort_abstract_class = self; NSPort_abstract_class = self;
#ifndef __MINGW__ #ifndef __MINGW32__
/* Must be kept in sync with [NSPortNameServer /* Must be kept in sync with [NSPortNameServer
+systemDefaultPortNameServer]. */ +systemDefaultPortNameServer]. */
if (GSUserDefaultsFlag(GSMacOSXCompatible) == YES if (GSUserDefaultsFlag(GSMacOSXCompatible) == YES

View file

@ -69,7 +69,7 @@
/* Must be kept in sync with [NSPort +initialize]. */ /* Must be kept in sync with [NSPort +initialize]. */
if (GSUserDefaultsFlag(GSMacOSXCompatible) == YES) if (GSUserDefaultsFlag(GSMacOSXCompatible) == YES)
{ {
#ifndef __MINGW__ #ifndef __MINGW32__
return [NSMessagePortNameServer sharedInstance]; return [NSMessagePortNameServer sharedInstance];
#else #else
return [NSSocketPortNameServer sharedInstance]; return [NSSocketPortNameServer sharedInstance];
@ -104,7 +104,7 @@
} }
else else
{ {
#ifndef __MINGW__ #ifndef __MINGW32__
return [NSMessagePortNameServer sharedInstance]; return [NSMessagePortNameServer sharedInstance];
#else #else
return [NSSocketPortNameServer sharedInstance]; return [NSSocketPortNameServer sharedInstance];

View file

@ -210,7 +210,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
} }
else else
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
unichar *buffer; unichar *buffer;
int buffer_size = 0; int buffer_size = 0;
int needed_size = 0; int needed_size = 0;
@ -292,7 +292,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
i = 0; i = 0;
while (env[i]) while (env[i])
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
char buf[1024]; char buf[1024];
char *cp; char *cp;
DWORD len; DWORD len;
@ -738,7 +738,7 @@ _gnu_noobjc_free_vars(void)
} }
#else /*! HAVE_PROCFS !HAVE_LOAD_METHOD !HAVE_KVM_ENV */ #else /*! HAVE_PROCFS !HAVE_LOAD_METHOD !HAVE_KVM_ENV */
#ifdef __MINGW__ #ifdef __MINGW32__
/* For WindowsAPI Library, we know the global variables (argc, etc) */ /* For WindowsAPI Library, we know the global variables (argc, etc) */
+ (void) initialize + (void) initialize
{ {
@ -775,7 +775,7 @@ int main(int argc, char *argv[], char *env[])
sizeof(_NSConstantStringClassReference)); sizeof(_NSConstantStringClassReference));
#endif #endif
#if defined(__MINGW__) #if defined(__MINGW32__)
WSADATA lpWSAData; WSADATA lpWSAData;
// Initialize Windows Sockets // Initialize Windows Sockets
@ -784,7 +784,7 @@ int main(int argc, char *argv[], char *env[])
printf("Could not startup Windows Sockets\n"); printf("Could not startup Windows Sockets\n");
exit(1); exit(1);
} }
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
#ifdef __MS_WIN__ #ifdef __MS_WIN__
_MB_init_runtime(); _MB_init_runtime();
@ -796,7 +796,7 @@ int main(int argc, char *argv[], char *env[])
return gnustep_base_user_main(argc, argv, env); return gnustep_base_user_main(argc, argv, env);
} }
#endif /* !GS_PASS_ARGUMENTS */ #endif /* !GS_PASS_ARGUMENTS */
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
#endif /* HAS_LOAD_METHOD && HAS_PROCFS */ #endif /* HAS_LOAD_METHOD && HAS_PROCFS */
@ -996,7 +996,7 @@ int main(int argc, char *argv[], char *env[])
{ {
int pid; int pid;
#if defined(__MINGW__) #if defined(__MINGW32__)
pid = (int)GetCurrentProcessId(); pid = (int)GetCurrentProcessId();
#else #else
pid = (int)getpid(); pid = (int)getpid();

View file

@ -955,7 +955,7 @@ extern IMP wRetImp;
{ {
when = min_watcher->_date; when = min_watcher->_date;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
// if there are handler for win32 messages // if there are handler for win32 messages
else if (context->msgTarget != nil) else if (context->msgTarget != nil)
{ {
@ -1007,7 +1007,7 @@ extern IMP wRetImp;
if ((context == nil || (watchers = context->watchers) == 0 if ((context == nil || (watchers = context->watchers) == 0
|| (i = GSIArrayCount(watchers)) == 0) || (i = GSIArrayCount(watchers)) == 0)
#if defined(__MINGW__) #if defined(__MINGW32__)
// there are inputs for win32 messages // there are inputs for win32 messages
&& context->msgTarget == 0) && context->msgTarget == 0)
#else #else

View file

@ -47,20 +47,20 @@
#include <unistd.h> /* for gethostname() */ #include <unistd.h> /* for gethostname() */
#endif #endif
#ifdef __MINGW__ #ifdef __MINGW32__
#define close closesocket #define close closesocket
#else #else
#include <sys/param.h> /* for MAXHOSTNAMELEN */ #include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> /* for inet_ntoa() */ #include <arpa/inet.h> /* for inet_ntoa() */
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <string.h> /* for strchr() */ #include <string.h> /* for strchr() */
#include <ctype.h> /* for strchr() */ #include <ctype.h> /* for strchr() */
#include <fcntl.h> #include <fcntl.h>
#ifdef __MINGW__ #ifdef __MINGW32__
#include <winsock2.h> #include <winsock2.h>
#include <wininet.h> #include <wininet.h>
#include <process.h> #include <process.h>
@ -97,7 +97,7 @@
#define SOCKET_ERROR -1 #define SOCKET_ERROR -1
#define INVALID_SOCKET -1 #define INVALID_SOCKET -1
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
/* /*
* Largest chunk of data possible in DO * Largest chunk of data possible in DO
@ -198,7 +198,7 @@ typedef enum {
unsigned nItems; /* Number of items to be read. */ unsigned nItems; /* Number of items to be read. */
GSHandleState state; /* State of the handle. */ GSHandleState state; /* State of the handle. */
unsigned int addrNum; /* Address number within host. */ unsigned int addrNum; /* Address number within host. */
#ifdef __MINGW__ #ifdef __MINGW32__
WSAEVENT event; /* Win32 event associated to socket */ WSAEVENT event; /* Win32 event associated to socket */
WSAEVENT eventTemp; /* Win32 event for asynchronous */ WSAEVENT eventTemp; /* Win32 event for asynchronous */
@public @public
@ -219,7 +219,7 @@ typedef enum {
+ (GSTcpHandle*) handleWithDescriptor: (SOCKET)d; + (GSTcpHandle*) handleWithDescriptor: (SOCKET)d;
- (BOOL) connectToPort: (NSSocketPort*)aPort beforeDate: (NSDate*)when; - (BOOL) connectToPort: (NSSocketPort*)aPort beforeDate: (NSDate*)when;
- (int) descriptor; - (int) descriptor;
#if defined(__MINGW__) #if defined(__MINGW32__)
- (int) eventHandle; - (int) eventHandle;
#endif #endif
- (void) invalidate; - (void) invalidate;
@ -368,13 +368,13 @@ static Class runLoopClass;
+ (GSTcpHandle*) handleWithDescriptor: (SOCKET)d + (GSTcpHandle*) handleWithDescriptor: (SOCKET)d
{ {
GSTcpHandle *handle; GSTcpHandle *handle;
#ifdef __MINGW__ #ifdef __MINGW32__
unsigned long dummy; unsigned long dummy;
#else #else
int e; int e;
#endif /* __MINGW__ */ #endif /* __MINGW32__ */
#ifdef __MINGW__ #ifdef __MINGW32__
WSAEVENT ev; WSAEVENT ev;
int rc; int rc;
#endif #endif
@ -384,7 +384,7 @@ static Class runLoopClass;
NSLog(@"illegal descriptor (%d) for Tcp Handle", d); NSLog(@"illegal descriptor (%d) for Tcp Handle", d);
return nil; return nil;
} }
#ifdef __MINGW__ #ifdef __MINGW32__
dummy = 1; dummy = 1;
if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR) if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR)
{ {
@ -392,7 +392,7 @@ static Class runLoopClass;
d, GSLastErrorStr(errno)); d, GSLastErrorStr(errno));
return nil; return nil;
} }
#else /* !__MINGW__ */ #else /* !__MINGW32__ */
if ((e = fcntl(d, F_GETFL, 0)) >= 0) if ((e = fcntl(d, F_GETFL, 0)) >= 0)
{ {
e |= NBLK_OPT; e |= NBLK_OPT;
@ -415,7 +415,7 @@ static Class runLoopClass;
handle->wMsgs = [NSMutableArray new]; handle->wMsgs = [NSMutableArray new];
handle->myLock = [GSLazyRecursiveLock new]; handle->myLock = [GSLazyRecursiveLock new];
handle->valid = YES; handle->valid = YES;
#if defined(__MINGW__) #if defined(__MINGW32__)
ev = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL); ev = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL);
if (ev == WSA_INVALID_EVENT) if (ev == WSA_INVALID_EVENT)
{ {
@ -436,7 +436,7 @@ static Class runLoopClass;
{ {
if (self == [GSTcpHandle class]) if (self == [GSTcpHandle class])
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
WORD wVersionRequested; WORD wVersionRequested;
WSADATA wsaData; WSADATA wsaData;
@ -537,7 +537,7 @@ static Class runLoopClass;
if (connect(desc, (struct sockaddr*)&sockAddr, sizeof(sockAddr)) if (connect(desc, (struct sockaddr*)&sockAddr, sizeof(sockAddr))
== SOCKET_ERROR) == SOCKET_ERROR)
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
if (WSAGetLastError() != WSAEWOULDBLOCK) if (WSAGetLastError() != WSAEWOULDBLOCK)
#else #else
if (errno != EINPROGRESS) if (errno != EINPROGRESS)
@ -564,7 +564,7 @@ static Class runLoopClass;
state = GS_H_TRYCON; state = GS_H_TRYCON;
l = [NSRunLoop currentRunLoop]; l = [NSRunLoop currentRunLoop];
#if defined(__MINGW__) #if defined(__MINGW32__)
NSAssert(event != WSA_INVALID_EVENT, @"Socket without win32 event!"); NSAssert(event != WSA_INVALID_EVENT, @"Socket without win32 event!");
[l addEvent: (void*)(gsaddr)event [l addEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
@ -590,7 +590,7 @@ static Class runLoopClass;
M_LOCK(myLock); M_LOCK(myLock);
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: NSConnectionReplyMode forMode: NSConnectionReplyMode
@ -669,7 +669,7 @@ static Class runLoopClass;
return desc; return desc;
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
- (int) eventHandle - (int) eventHandle
{ {
return (int)event; return (int)event;
@ -694,7 +694,7 @@ static Class runLoopClass;
valid = NO; valid = NO;
l = [runLoopClass currentRunLoop]; l = [runLoopClass currentRunLoop];
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: nil forMode: nil
@ -716,7 +716,7 @@ static Class runLoopClass;
NSDebugMLLog(@"GSTcpHandle", @"invalidated 0x%x", self); NSDebugMLLog(@"GSTcpHandle", @"invalidated 0x%x", self);
[[self recvPort] removeHandle: self]; [[self recvPort] removeHandle: self];
[[self sendPort] removeHandle: self]; [[self sendPort] removeHandle: self];
#if defined(__MINGW__) #if defined(__MINGW32__)
WSACloseEvent(event); WSACloseEvent(event);
event = WSA_INVALID_EVENT; event = WSA_INVALID_EVENT;
#endif #endif
@ -783,12 +783,12 @@ static Class runLoopClass;
[self invalidate]; [self invalidate];
return; return;
} }
#ifdef __MINGW__ #ifdef __MINGW32__
else if (WSAGetLastError()!= WSAEINTR else if (WSAGetLastError()!= WSAEINTR
&& WSAGetLastError()!= WSAEWOULDBLOCK) && WSAGetLastError()!= WSAEWOULDBLOCK)
#else #else
else if (errno != EINTR && errno != EAGAIN) else if (errno != EINTR && errno != EAGAIN)
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
{ {
NSDebugMLLog(@"GSTcpHandle", NSDebugMLLog(@"GSTcpHandle",
@"read failed - %s on 0x%x", GSLastErrorStr(errno), self); @"read failed - %s on 0x%x", GSLastErrorStr(errno), self);
@ -1133,23 +1133,23 @@ static Class runLoopClass;
res = send(desc, b + wLength, l - wLength, 0); res = send(desc, b + wLength, l - wLength, 0);
if (res < 0) if (res < 0)
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
if (WSAGetLastError()!= WSAEINTR if (WSAGetLastError()!= WSAEINTR
&& WSAGetLastError()!= WSAEWOULDBLOCK) && WSAGetLastError()!= WSAEWOULDBLOCK)
#else #else
if (errno != EINTR && errno != EAGAIN) if (errno != EINTR && errno != EAGAIN)
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
{ {
NSLog(@"write attempt failed - %s", GSLastErrorStr(errno)); NSLog(@"write attempt failed - %s", GSLastErrorStr(errno));
[self invalidate]; [self invalidate];
return; return;
} }
#ifdef __MINGW__ #ifdef __MINGW32__
if (WSAGetLastError()== WSAEWOULDBLOCK) if (WSAGetLastError()== WSAEWOULDBLOCK)
{ {
readyToSend = NO; readyToSend = NO;
} }
#endif /* !__MINGW__ */ #endif /* !__MINGW32__ */
} }
else else
{ {
@ -1194,7 +1194,7 @@ static Class runLoopClass;
extra: (void*)extra extra: (void*)extra
forMode: (NSString*)mode forMode: (NSString*)mode
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
WSANETWORKEVENTS ocurredEvents; WSANETWORKEVENTS ocurredEvents;
#endif #endif
NSDebugMLLog(@"GSTcpHandle", @"received %s event on 0x%x", NSDebugMLLog(@"GSTcpHandle", @"received %s event on 0x%x",
@ -1207,7 +1207,7 @@ static Class runLoopClass;
{ {
NSRunLoop *l = [runLoopClass currentRunLoop]; NSRunLoop *l = [runLoopClass currentRunLoop];
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: data [l removeEvent: data
type: ET_HANDLE type: ET_HANDLE
forMode: mode forMode: mode
@ -1227,7 +1227,7 @@ static Class runLoopClass;
M_LOCK(myLock); M_LOCK(myLock);
#if defined(__MINGW__) #if defined(__MINGW32__)
if (WSAEnumNetworkEvents(desc, event, &ocurredEvents)==SOCKET_ERROR) if (WSAEnumNetworkEvents(desc, event, &ocurredEvents)==SOCKET_ERROR)
{ {
NSLog(@"Error getting event type %d", WSAGetLastError()); NSLog(@"Error getting event type %d", WSAGetLastError());
@ -1324,7 +1324,7 @@ static Class runLoopClass;
RETAIN(self); RETAIN(self);
#if defined(__MINGW__) #if defined(__MINGW32__)
NSAssert(event != WSA_INVALID_EVENT, @"Socket without win32 event!"); NSAssert(event != WSA_INVALID_EVENT, @"Socket without win32 event!");
[l addEvent: (void*)(gsaddr)event [l addEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
@ -1347,7 +1347,7 @@ static Class runLoopClass;
&& [when timeIntervalSinceNow] > 0) && [when timeIntervalSinceNow] > 0)
{ {
M_UNLOCK(myLock); M_UNLOCK(myLock);
#if defined(__MINGW__) #if defined(__MINGW32__)
if (readyToSend) if (readyToSend)
{ {
[self receivedEventWrite]; [self receivedEventWrite];
@ -1362,7 +1362,7 @@ static Class runLoopClass;
M_LOCK(myLock); M_LOCK(myLock);
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
[l removeEvent: (void*)(gsaddr)event [l removeEvent: (void*)(gsaddr)event
type: ET_HANDLE type: ET_HANDLE
forMode: NSConnectionReplyMode forMode: NSConnectionReplyMode
@ -1548,7 +1548,7 @@ static unsigned wordAlign;
port->address = [addr copy]; port->address = [addr copy];
port->handles = NSCreateMapTable(NSIntMapKeyCallBacks, port->handles = NSCreateMapTable(NSIntMapKeyCallBacks,
NSObjectMapValueCallBacks, 0); NSObjectMapValueCallBacks, 0);
#if defined(__MINGW__) #if defined(__MINGW32__)
port->eventListener = WSA_INVALID_EVENT; port->eventListener = WSA_INVALID_EVENT;
port->events = NSCreateMapTable(NSIntMapKeyCallBacks, port->events = NSCreateMapTable(NSIntMapKeyCallBacks,
NSIntMapValueCallBacks, 0); NSIntMapValueCallBacks, 0);
@ -1644,7 +1644,7 @@ static unsigned wordAlign;
} }
else else
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
int rc; int rc;
#endif #endif
/* /*
@ -1654,7 +1654,7 @@ static unsigned wordAlign;
*/ */
port->listener = desc; port->listener = desc;
port->portNum = GSSwapBigI16ToHost(sockaddr.sin_port); port->portNum = GSSwapBigI16ToHost(sockaddr.sin_port);
#if defined(__MINGW__) #if defined(__MINGW32__)
port->eventListener = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL); port->eventListener = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL);
if (port->eventListener == WSA_INVALID_EVENT) if (port->eventListener == WSA_INVALID_EVENT)
{ {
@ -1737,7 +1737,7 @@ static unsigned wordAlign;
handle->recvPort = GS_GC_HIDE(self); handle->recvPort = GS_GC_HIDE(self);
} }
NSMapInsert(handles, (void*)(gsaddr)[handle descriptor], (void*)handle); NSMapInsert(handles, (void*)(gsaddr)[handle descriptor], (void*)handle);
#if defined(__MINGW__) #if defined(__MINGW32__)
NSMapInsert(events, (void*)(gsaddr)[handle eventHandle], NSMapInsert(events, (void*)(gsaddr)[handle eventHandle],
(void*)(gsaddr)[handle descriptor]); (void*)(gsaddr)[handle descriptor]);
#endif #endif
@ -1790,7 +1790,7 @@ static unsigned wordAlign;
* This is a callback method used by the NSRunLoop class to determine which * This is a callback method used by the NSRunLoop class to determine which
* descriptors to watch for the port. * descriptors to watch for the port.
*/ */
#if defined(__MINGW__) #if defined(__MINGW32__)
- (void) getFds: (int*)fds count: (int*)count - (void) getFds: (int*)fds count: (int*)count
{ {
NSMapEnumerator me; NSMapEnumerator me;
@ -2029,7 +2029,7 @@ static unsigned wordAlign;
{ {
(void) close(listener); (void) close(listener);
listener = -1; listener = -1;
#if defined(__MINGW__) #if defined(__MINGW32__)
WSACloseEvent(eventListener); WSACloseEvent(eventListener);
eventListener = WSA_INVALID_EVENT; eventListener = WSA_INVALID_EVENT;
#endif #endif
@ -2058,7 +2058,7 @@ static unsigned wordAlign;
handles = 0; handles = 0;
} }
} }
#if defined(__MINGW__) #if defined(__MINGW32__)
if (events != 0) if (events != 0)
{ {
NSFreeMapTable(events); NSFreeMapTable(events);
@ -2100,7 +2100,7 @@ static unsigned wordAlign;
extra: (void*)extra extra: (void*)extra
forMode: (NSString*)mode forMode: (NSString*)mode
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
WSAEVENT event = (WSAEVENT)extra; WSAEVENT event = (WSAEVENT)extra;
SOCKET desc; SOCKET desc;
#else #else
@ -2111,7 +2111,7 @@ static unsigned wordAlign;
NSDebugMLLog(@"NSPort", @"received %s event on 0x%x", NSDebugMLLog(@"NSPort", @"received %s event on 0x%x",
type == ET_RPORT ? "read" : "write", self); type == ET_RPORT ? "read" : "write", self);
#if defined(__MINGW__) #if defined(__MINGW32__)
if (event == eventListener) if (event == eventListener)
#else #else
if (desc == listener) if (desc == listener)
@ -2131,7 +2131,7 @@ static unsigned wordAlign;
setsockopt(desc, SOL_SOCKET, SO_KEEPALIVE, (char*)&status, setsockopt(desc, SOL_SOCKET, SO_KEEPALIVE, (char*)&status,
sizeof(status)); sizeof(status));
#if defined(__MINGW__) #if defined(__MINGW32__)
// reset associated event with new socket // reset associated event with new socket
WSAEventSelect(desc, eventListener, 0); WSAEventSelect(desc, eventListener, 0);
#endif #endif
@ -2152,7 +2152,7 @@ static unsigned wordAlign;
else else
{ {
M_LOCK(myLock); M_LOCK(myLock);
#if defined(__MINGW__) #if defined(__MINGW32__)
desc = (SOCKET)NSMapGet(events, (void*)(gsaddr)event); desc = (SOCKET)NSMapGet(events, (void*)(gsaddr)event);
#endif #endif
handle = (GSTcpHandle*)NSMapGet(handles, (void*)(gsaddr)desc); handle = (GSTcpHandle*)NSMapGet(handles, (void*)(gsaddr)desc);
@ -2162,7 +2162,7 @@ static unsigned wordAlign;
{ {
const char *t; const char *t;
#if defined(__MINGW__) #if defined(__MINGW32__)
if (type == ET_HANDLE) t = "winhandle"; if (type == ET_HANDLE) t = "winhandle";
#else #else
if (type == ET_RDESC) t = "rdesc"; if (type == ET_RDESC) t = "rdesc";
@ -2212,7 +2212,7 @@ static unsigned wordAlign;
handle->recvPort = nil; handle->recvPort = nil;
} }
NSMapRemove(handles, (void*)(gsaddr)[handle descriptor]); NSMapRemove(handles, (void*)(gsaddr)[handle descriptor]);
#if defined(__MINGW__) #if defined(__MINGW32__)
NSMapRemove(events, (void*)(gsaddr)[handle eventHandle]); NSMapRemove(events, (void*)(gsaddr)[handle eventHandle]);
#endif #endif
if (((int) listener) < 0 && NSCountMapTable(handles) == 0) if (((int) listener) < 0 && NSCountMapTable(handles) == 0)

View file

@ -42,7 +42,7 @@
#include "Foundation/NSPathUtilities.h" #include "Foundation/NSPathUtilities.h"
#include "Foundation/NSPortNameServer.h" #include "Foundation/NSPortNameServer.h"
#include "Foundation/NSDebug.h" #include "Foundation/NSDebug.h"
#ifdef __MINGW__ #ifdef __MINGW32__
#include <winsock2.h> #include <winsock2.h>
#include <wininet.h> #include <wininet.h>
#else #else

View file

@ -4121,7 +4121,7 @@ static NSFileManager *fm = nil;
- (NSString*) stringByResolvingSymlinksInPath - (NSString*) stringByResolvingSymlinksInPath
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
return IMMUTABLE(self); return IMMUTABLE(self);
#else #else
#ifndef MAX_PATH #ifndef MAX_PATH
@ -4284,7 +4284,7 @@ static NSFileManager *fm = nil;
} }
return [[NSFileManager defaultManager] return [[NSFileManager defaultManager]
stringWithFileSystemRepresentation: newBuf length: strlen(newBuf)]; stringWithFileSystemRepresentation: newBuf length: strlen(newBuf)];
#endif /* (__MINGW__) */ #endif /* (__MINGW32__) */
} }
- (NSString*) stringByStandardizingPath - (NSString*) stringByStandardizingPath
@ -4377,7 +4377,7 @@ static NSFileManager *fm = nil;
* For absolute paths, we must resolve symbolic links or (on MINGW) * For absolute paths, we must resolve symbolic links or (on MINGW)
* remove '/../' sequences and their matching parent directories. * remove '/../' sequences and their matching parent directories.
*/ */
#if defined(__MINGW__) #if defined(__MINGW32__)
/* Condense `/../' */ /* Condense `/../' */
r = (NSRange){root, l-root}; r = (NSRange){root, l-root};
while ((r = [s rangeOfString: @"/.." options: 0 range: r]).length == 3) while ((r = [s rangeOfString: @"/.." options: 0 range: r]).length == 3)
@ -4543,7 +4543,7 @@ static NSFileManager *fm = nil;
*/ */
if (c == '/') if (c == '/')
{ {
#if defined(__MINGW__) #if defined(__MINGW32__)
if (GSPathHandlingUnix() == YES) if (GSPathHandlingUnix() == YES)
{ {
return YES; return YES;

View file

@ -109,12 +109,12 @@ static BOOL hadChildSignal = NO;
static void handleSignal(int sig) static void handleSignal(int sig)
{ {
hadChildSignal = YES; hadChildSignal = YES;
#ifndef __MINGW__ #ifndef __MINGW32__
signal(SIGCHLD, handleSignal); signal(SIGCHLD, handleSignal);
#endif #endif
} }
#ifdef __MINGW__ #ifdef __MINGW32__
@interface NSConcreteWindowsTask : NSTask @interface NSConcreteWindowsTask : NSTask
{ {
@public @public
@ -254,7 +254,7 @@ pty_slave(const char* name)
} }
[gnustep_global_lock unlock]; [gnustep_global_lock unlock];
#ifndef __MINGW__ #ifndef __MINGW32__
signal(SIGCHLD, handleSignal); signal(SIGCHLD, handleSignal);
#endif #endif
} }
@ -349,7 +349,7 @@ pty_slave(const char* name)
return; return;
} }
#ifndef __MINGW__ #ifndef __MINGW32__
#ifdef HAVE_KILLPG #ifdef HAVE_KILLPG
killpg(_taskId, SIGINT); killpg(_taskId, SIGINT);
#else #else
@ -417,7 +417,7 @@ pty_slave(const char* name)
[NSException raise: NSInvalidArgumentException [NSException raise: NSInvalidArgumentException
format: @"NSTask - task has not yet launched"]; format: @"NSTask - task has not yet launched"];
} }
#ifndef __MINGW__ #ifndef __MINGW32__
#ifdef HAVE_KILLPG #ifdef HAVE_KILLPG
killpg(_taskId, SIGCONT); killpg(_taskId, SIGCONT);
#else #else
@ -608,7 +608,7 @@ pty_slave(const char* name)
[NSException raise: NSInvalidArgumentException [NSException raise: NSInvalidArgumentException
format: @"NSTask - task has not yet launched"]; format: @"NSTask - task has not yet launched"];
} }
#ifndef __MINGW__ #ifndef __MINGW32__
#ifdef HAVE_KILLPG #ifdef HAVE_KILLPG
killpg(_taskId, SIGSTOP); killpg(_taskId, SIGSTOP);
#else #else
@ -640,7 +640,7 @@ pty_slave(const char* name)
} }
_hasTerminated = YES; _hasTerminated = YES;
#ifndef __MINGW__ #ifndef __MINGW32__
#ifdef HAVE_KILLPG #ifdef HAVE_KILLPG
killpg(_taskId, SIGTERM); killpg(_taskId, SIGTERM);
#else #else
@ -741,7 +741,7 @@ pty_slave(const char* name)
full_path = [arch_path stringByAppendingPathComponent: libs]; full_path = [arch_path stringByAppendingPathComponent: libs];
lpath = [full_path stringByAppendingPathComponent: prog]; lpath = [full_path stringByAppendingPathComponent: prog];
#ifdef __MINGW__ #ifdef __MINGW32__
if ([mgr isExecutableFileAtPath: lpath] == NO if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath: && [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO) (lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
@ -750,7 +750,7 @@ pty_slave(const char* name)
#endif #endif
{ {
lpath = [arch_path stringByAppendingPathComponent: prog]; lpath = [arch_path stringByAppendingPathComponent: prog];
#ifdef __MINGW__ #ifdef __MINGW32__
if ([mgr isExecutableFileAtPath: lpath] == NO if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath: && [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO) (lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
@ -759,7 +759,7 @@ pty_slave(const char* name)
#endif #endif
{ {
lpath = [base_path stringByAppendingPathComponent: prog]; lpath = [base_path stringByAppendingPathComponent: prog];
#ifdef __MINGW__ #ifdef __MINGW32__
if ([mgr isExecutableFileAtPath: lpath] == NO if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath: && [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO) (lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
@ -778,7 +778,7 @@ pty_slave(const char* name)
} }
if (lpath != nil) if (lpath != nil)
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
if ([mgr isExecutableFileAtPath: lpath] == NO if ([mgr isExecutableFileAtPath: lpath] == NO
&& [mgr isExecutableFileAtPath: && [mgr isExecutableFileAtPath:
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] (lpath = [lpath stringByAppendingPathExtension: @"exe"])]
@ -903,7 +903,7 @@ pty_slave(const char* name)
@end @end
#ifdef __MINGW__ #ifdef __MINGW32__
@implementation NSConcreteWindowsTask @implementation NSConcreteWindowsTask
BOOL BOOL
@ -1402,7 +1402,7 @@ GSCheckTasks()
setpgrp(getpid(), getpid()); setpgrp(getpid(), getpid());
#endif #endif
#else #else
#if defined(__MINGW__) #if defined(__MINGW32__)
pid = (int)GetCurrentProcessId(), pid = (int)GetCurrentProcessId(),
#else #else
pid = (int)getpid(); pid = (int)getpid();

View file

@ -162,7 +162,7 @@ GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when)
while (delay > 30.0*60.0) while (delay > 30.0*60.0)
{ {
// sleep 30 minutes // sleep 30 minutes
#if defined(__MINGW__) #if defined(__MINGW32__)
Sleep (30*60*1000); Sleep (30*60*1000);
#else #else
sleep (30*60); sleep (30*60);
@ -179,7 +179,7 @@ GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when)
#ifdef HAVE_USLEEP #ifdef HAVE_USLEEP
usleep ((int)(delay*1000000)); usleep ((int)(delay*1000000));
#else #else
#if defined(__MINGW__) #if defined(__MINGW32__)
Sleep (delay*1000); Sleep (delay*1000);
#else #else
sleep ((int)delay); sleep ((int)delay);
@ -793,7 +793,7 @@ gnustep_base_thread_callback(void)
@implementation GSPerformHolder @implementation GSPerformHolder
static NSLock *subthreadsLock = nil; static NSLock *subthreadsLock = nil;
#ifdef __MINGW__ #ifdef __MINGW32__
static HANDLE event; static HANDLE event;
#else #else
static int inputFd = -1; static int inputFd = -1;
@ -813,7 +813,7 @@ static NSDate *theFuture;
subthreadsLock = [[NSLock alloc] init]; subthreadsLock = [[NSLock alloc] init];
perfArray = [[NSMutableArray alloc] initWithCapacity: 10]; perfArray = [[NSMutableArray alloc] initWithCapacity: 10];
#ifndef __MINGW__ #ifndef __MINGW32__
{ {
int fd[2]; int fd[2];
@ -877,7 +877,7 @@ static NSDate *theFuture;
[perfArray addObject: h]; [perfArray addObject: h];
#if defined(__MINGW__) #if defined(__MINGW32__)
if (SetEvent(event) == 0) if (SetEvent(event) == 0)
{ {
NSLog(@"Set event failed - %@", GSLastErrorStr(errno)); NSLog(@"Set event failed - %@", GSLastErrorStr(errno));
@ -906,7 +906,7 @@ static NSDate *theFuture;
[subthreadsLock lock]; [subthreadsLock lock];
#if defined(__MINGW__) #if defined(__MINGW32__)
if (ResetEvent(event) == 0) if (ResetEvent(event) == 0)
{ {
NSLog(@"Reset event failed - %@", GSLastErrorStr(errno)); NSLog(@"Reset event failed - %@", GSLastErrorStr(errno));

View file

@ -910,7 +910,7 @@ static NSMapTable *absolutes = 0;
/* Read dictionary from file. */ /* Read dictionary from file. */
abbreviationMap = [[NSMutableDictionary alloc] init]; abbreviationMap = [[NSMutableDictionary alloc] init];
path = _time_zone_path (ABBREV_MAP, nil); path = _time_zone_path (ABBREV_MAP, nil);
#if defined(__MINGW__) #if defined(__MINGW32__)
{ {
unichar mode[3]; unichar mode[3];
mode[0] = 'r'; mode[0] = 'r';
@ -1336,7 +1336,7 @@ static NSMapTable *absolutes = 0;
temp_array[i] = [NSMutableArray array]; temp_array[i] = [NSMutableArray array];
fileName = _time_zone_path (REGIONS_FILE, nil); fileName = _time_zone_path (REGIONS_FILE, nil);
#if defined(__MINGW__) #if defined(__MINGW32__)
{ {
unichar mode[3]; unichar mode[3];
mode[0] = 'r'; mode[0] = 'r';

View file

@ -609,7 +609,7 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
{ {
currLang = [NSArray arrayWithObject: GSLanguageFromLocale(locale)]; currLang = [NSArray arrayWithObject: GSLanguageFromLocale(locale)];
} }
#ifdef __MINGW__ #ifdef __MINGW32__
if (currLang == nil && locale != nil) if (currLang == nil && locale != nil)
{ {
/* Check for language as the first part of the locale string */ /* Check for language as the first part of the locale string */

View file

@ -106,7 +106,7 @@ objc_initialize_loading(FILE *errorStream)
dynamic_loaded = NO; dynamic_loaded = NO;
path = objc_executable_location(); path = objc_executable_location();
#ifdef __MINGW__ #ifdef __MINGW32__
NSDebugFLLog(@"NSBundle", NSDebugFLLog(@"NSBundle",
@"Debug (objc-load): initializing dynamic loader for %S", @"Debug (objc-load): initializing dynamic loader for %S",
path); path);
@ -177,7 +177,7 @@ objc_load_module (const char *filename,
_objc_load_callback = objc_load_callback; _objc_load_callback = objc_load_callback;
/* Link in the object file */ /* Link in the object file */
#ifdef __MINGW__ #ifdef __MINGW32__
NSDebugFLLog(@"NSBundle", NSDebugFLLog(@"NSBundle",
@"Debug (objc-load): Linking file %S\n", filename); @"Debug (objc-load): Linking file %S\n", filename);
#else #else
@ -288,7 +288,7 @@ objc_unload_modules(FILE *errorStream,
return 0; return 0;
} }
#ifdef __MINGW__ #ifdef __MINGW32__
NSString * NSString *
objc_get_symbol_path(Class theClass, Category *theCategory) objc_get_symbol_path(Class theClass, Category *theCategory)
{ {

View file

@ -501,7 +501,7 @@ int main (int argc, char *argv[], char **env)
unsigned connect_attempts; unsigned connect_attempts;
NSAutoreleasePool *arp; NSAutoreleasePool *arp;
Auth *auth; Auth *auth;
#ifndef __MINGW__ #ifndef __MINGW32__
extern int optind; extern int optind;
extern char *optarg; extern char *optarg;
#endif #endif

View file

@ -476,7 +476,7 @@ int main(int argc, char *argv[], char **env)
id o = [[NSObject alloc] init]; id o = [[NSObject alloc] init];
NSConnection *c; NSConnection *c;
NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSAutoreleasePool *arp = [NSAutoreleasePool new];
#ifndef __MINGW__ #ifndef __MINGW32__
extern int optind; extern int optind;
extern char *optarg; extern char *optarg;
#endif #endif

View file

@ -38,7 +38,7 @@ main()
name: NSTaskDidTerminateNotification name: NSTaskDidTerminateNotification
object: nil]; object: nil];
#ifdef __MINGW__ #ifdef __MINGW32__
task = [NSTask launchedTaskWithLaunchPath: @"C:\\windows\\system32\\mem.exe" task = [NSTask launchedTaskWithLaunchPath: @"C:\\windows\\system32\\mem.exe"
arguments: nil]; arguments: nil];
#else #else

View file

@ -8,7 +8,7 @@
This file is part of the GNUstep Base Library. This file is part of the GNUstep Base Library.
*/ */
#if (defined __MINGW__) #if (defined __MINGW32__)
/* A simple implementation of getopt() */ /* A simple implementation of getopt() */
static int static int
indexof(char c, char *string) indexof(char c, char *string)

View file

@ -24,7 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#ifdef __MINGW__ #ifdef __MINGW32__
#include "process.h" #include "process.h"
#endif #endif
@ -395,7 +395,7 @@ ihandler(int sig)
} }
else else
{ {
#ifdef __MINGW__ #ifdef __MINGW32__
isPublic = YES; isPublic = YES;
#else #else
isLocal = YES; isLocal = YES;
@ -425,7 +425,7 @@ ihandler(int sig)
port = (NSPort*)[NSSocketPort port]; port = (NSPort*)[NSSocketPort port];
} }
} }
#ifndef __MINGW__ #ifndef __MINGW32__
else else
{ {
hostname = @""; hostname = @"";
@ -1108,7 +1108,7 @@ main(int argc, char** argv, char** env)
{ {
signal(sym, ihandler); signal(sym, ihandler);
} }
#ifndef __MINGW__ #ifndef __MINGW32__
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
signal(SIGTTOU, SIG_IGN); signal(SIGTTOU, SIG_IGN);
signal(SIGTTIN, SIG_IGN); signal(SIGTTIN, SIG_IGN);
@ -1130,7 +1130,7 @@ main(int argc, char** argv, char** env)
*/ */
[[NSFileHandle fileHandleWithStandardInput] closeFile]; [[NSFileHandle fileHandleWithStandardInput] closeFile];
[[NSFileHandle fileHandleWithStandardOutput] closeFile]; [[NSFileHandle fileHandleWithStandardOutput] closeFile];
#ifndef __MINGW__ #ifndef __MINGW32__
if (debugging == NO) if (debugging == NO)
{ {
[[NSFileHandle fileHandleWithStandardError] closeFile]; [[NSFileHandle fileHandleWithStandardError] closeFile];

View file

@ -71,7 +71,7 @@ main(int argc, char** argv, char **env)
NSString *name = [[args objectAtIndex: 1] lowercaseString]; NSString *name = [[args objectAtIndex: 1] lowercaseString];
NSString *sep; NSString *sep;
#ifdef __MINGW__ #ifdef __MINGW32__
sep = @";"; sep = @";";
#else #else
sep = @":"; sep = @":";