mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
generalize define from __MINGW32__ to __MINGW__
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30001 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7e8eeb6142
commit
1a5d643771
51 changed files with 404 additions and 350 deletions
54
ChangeLog
54
ChangeLog
|
@ -1,3 +1,57 @@
|
|||
2010-03-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* config/config.reuseaddr.c:
|
||||
* Examples/nsconnection_client.m:
|
||||
* Examples/nsconnection_server.m:
|
||||
* Headers/Additions/GNUstepBase/GSConfig.h.in:
|
||||
* Headers/Additions/GNUstepBase/GSFileHandle.h:
|
||||
* Headers/Additions/GNUstepBase/GSVersionMacros.h:
|
||||
* Headers/Additions/GNUstepBase/preface.h.in:
|
||||
* Headers/Foundation/NSPort.h:
|
||||
* Headers/Foundation/NSRunLoop.h:
|
||||
* Source/Additions/NSError+GNUstepBase.m:
|
||||
* Source/Additions/NSTask+GNUstepBase.m:
|
||||
* Source/cifframe.h:
|
||||
* Source/GSFileHandle.m:
|
||||
* Source/GSHTTPURLHandle.m:
|
||||
* Source/GSNetwork.h:
|
||||
* Source/GSPortPrivate.h:
|
||||
* Source/GSPrivate.h:
|
||||
* Source/GSRunLoopCtxt.h:
|
||||
* Source/GSRunLoopWatcher.m:
|
||||
* Source/GSSocketStream.m:
|
||||
* Source/GSStream.m:
|
||||
* Source/NSBundle.m:
|
||||
* Source/NSCalendarDate.m:
|
||||
* Source/NSConnection.m:
|
||||
* Source/NSData.m:
|
||||
* Source/NSDebug.m:
|
||||
* Source/NSException.m:
|
||||
* Source/NSFileManager.m:
|
||||
* Source/NSHost.m:
|
||||
* Source/NSInvocation.m:
|
||||
* Source/NSLog.m:
|
||||
* Source/NSObject.m:
|
||||
* Source/NSPage.m:
|
||||
* Source/NSPathUtilities.m:
|
||||
* Source/NSPipe.m:
|
||||
* Source/NSProcessInfo.m:
|
||||
* Source/NSSocketPort.m:
|
||||
* Source/NSSocketPortNameServer.m:
|
||||
* Source/NSString.m:
|
||||
* Source/NSTask.m:
|
||||
* Source/NSThread.m:
|
||||
* Source/NSTimeZone.m:
|
||||
* Source/NSURL.m:
|
||||
* Source/NSUserDefaults.m:
|
||||
* Source/objc-load.m:
|
||||
* Source/ObjectiveC2/blocks_runtime.m:
|
||||
* SSL/GSSSLHandle.m:
|
||||
* Tools/gdnc.m:
|
||||
* Tools/gdomap.c:
|
||||
* Tools/gspath.m:
|
||||
Use __MINGW__ rather than __MINGW32__ for windows tests.
|
||||
|
||||
2010-03-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSMime.m:
|
||||
|
|
|
@ -212,7 +212,7 @@ int con_data (id prx)
|
|||
printf(" got %x\n", ss.z);
|
||||
[pool release];
|
||||
|
||||
#if 1 || !defined(__MINGW32__)
|
||||
#if 1 || !defined(__MINGW__)
|
||||
pool = [NSAutoreleasePool new];
|
||||
printf("Struct:\n");
|
||||
memcpy(&bck, &ffoo, sizeof(bck));
|
||||
|
@ -507,7 +507,7 @@ int main (int argc, char *argv[], char **env)
|
|||
NSAutoreleasePool *arp;
|
||||
NSPortNameServer *ns;
|
||||
Auth *auth;
|
||||
#ifndef __MINGW32__
|
||||
#if !defined(__MINGW__)
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
#endif
|
||||
|
|
|
@ -484,7 +484,7 @@ int main(int argc, char *argv[], char **env)
|
|||
NSPortNameServer *ns;
|
||||
NSPort *port;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
#ifndef __MINGW32__
|
||||
#if !defined(__MINGW__)
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,7 @@ typedef gsuaddr gsaddr;
|
|||
/*
|
||||
* Native character type for use in systemcalls etc.
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#define GSNativeChar uint16_t
|
||||
#else
|
||||
#define GSNativeChar char
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#if USE_ZLIB
|
||||
gzFile gzDescriptor;
|
||||
#endif
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEVENT event;
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
|
||||
#if BUILD_libgnustep_base_DLL
|
||||
#
|
||||
# if defined(__MINGW32__)
|
||||
# if defined(__MINGW__)
|
||||
/* On Mingw, the compiler will export all symbols automatically, so
|
||||
* __declspec(dllexport) is not needed.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,18 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
#if defined(__WIN32__) || defined(_WIN32) || defined(__MS_WIN32__)
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
# if !defined(__WIN32__)
|
||||
# define __WIN32__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#define __MINGW__
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
#if defined(__MINGW32__)
|
||||
# if !defined(__MINGW__)
|
||||
# define __MINGW__
|
||||
# endif
|
||||
# if !defined(__WIN32__)
|
||||
# define __WIN32__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__WIN32__)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSMapTable.h>
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#include <winsock2.h>
|
||||
#include <wininet.h>
|
||||
#else
|
||||
|
@ -206,7 +206,7 @@ typedef SOCKET NSSocketNativeHandle;
|
|||
uint16_t portNum; /* TCP port in host byte order. */
|
||||
SOCKET listener;
|
||||
NSMapTable *handles; /* Handles indexed by socket. */
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEVENT eventListener;
|
||||
NSMapTable *events;
|
||||
#endif
|
||||
|
|
|
@ -121,7 +121,7 @@ GS_EXPORT NSString * const NSDefaultRunLoopMode;
|
|||
* using NSStream, at which point this API will be redundant.
|
||||
*/
|
||||
typedef enum {
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
ET_HANDLE, /* Watch for an I/O event on a handle. */
|
||||
ET_RPORT, /* Watch for message arriving on port. */
|
||||
ET_WINMSG, /* Watch for a message on a window handle. */
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
|
@ -64,7 +64,7 @@
|
|||
#import "GNUstepBase/GSFileHandle.h"
|
||||
#import "GSPrivate.h"
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
|
@ -74,7 +74,7 @@
|
|||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <signal.h>
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#import "Foundation/NSError.h"
|
||||
#import "GSPrivate.h"
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
|||
@implementation NSError(GNUstepBase)
|
||||
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
#if !defined(HAVE_STRERROR_R)
|
||||
#if defined(HAVE_STRERROR)
|
||||
static int
|
||||
|
@ -89,7 +89,7 @@ strerror_r(int eno, char *buf, int len)
|
|||
+ (NSError*) _last
|
||||
{
|
||||
int eno;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
eno = GetLastError();
|
||||
if (eno == 0) eno = errno;
|
||||
#else
|
||||
|
@ -103,7 +103,7 @@ strerror_r(int eno, char *buf, int len)
|
|||
NSError *error;
|
||||
NSString *domain;
|
||||
NSDictionary *info;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
LPVOID lpMsgBuf;
|
||||
NSString *message;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
static NSString*
|
||||
executablePath(NSFileManager *mgr, NSString *path)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSString *tmp;
|
||||
|
||||
if ([mgr isExecutableFileAtPath: path])
|
||||
|
@ -99,7 +99,7 @@ executablePath(NSFileManager *mgr, NSString *path)
|
|||
|
||||
env = [[NSProcessInfo processInfo] environment];
|
||||
pathlist = [env objectForKey:@"PATH"];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* Windows 2000 and perhaps others have "Path" not "PATH" */
|
||||
if (pathlist == nil)
|
||||
{
|
||||
|
|
|
@ -1093,7 +1093,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (fstat(desc, &sbuf) < 0)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* On windows, an fstat will fail if the descriptor is a pipe
|
||||
* or socket, so we simply mark the descriptor as not being a
|
||||
* standard file.
|
||||
|
|
|
@ -313,7 +313,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
[[NSProcessInfo processInfo] processIdentifier]];
|
||||
IF_NO_GC([debugFile retain];)
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
sslClass = [NSFileHandle sslClass];
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
|
||||
#include <io.h>
|
||||
#include <winsock2.h>
|
||||
|
@ -72,7 +72,7 @@
|
|||
#define GSNETERROR errno
|
||||
#define GSWOULDBLOCK (errno == EINPROGRESS)
|
||||
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#ifndef INADDRSZ
|
||||
#define INADDRSZ 4
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
- (BOOL) removePort: (NSPort*)port forName: (NSString*)name;
|
||||
@end
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
@interface NSMessagePort(Private)
|
||||
+ (id) newWithName: (NSString*)name;
|
||||
- (id) initWithName: (NSString*)name;
|
||||
|
@ -52,7 +52,7 @@
|
|||
- (void) addHandle: (GSMessageHandle*)handle forSend: (BOOL)send;
|
||||
- (void) removeHandle: (GSMessageHandle*)handle;
|
||||
@end
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
@class GSTcpHandle;
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ typedef enum {
|
|||
NSRunLoop *loop;
|
||||
NSLock *lock;
|
||||
NSMutableArray *performers;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
HANDLE event;
|
||||
#else
|
||||
int inputFd;
|
||||
|
|
|
@ -69,7 +69,7 @@ typedef struct{
|
|||
unsigned maxWatchers;
|
||||
NSTimer *housekeeper; /** Housekeeping timer for loop. */
|
||||
@private
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSMapTable *handleMap;
|
||||
NSMapTable *winMsgMap;
|
||||
#else
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
data = item;
|
||||
switch (aType)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
case ET_HANDLE: type = aType; break;
|
||||
case ET_WINMSG: type = aType; break;
|
||||
#else
|
||||
|
|
|
@ -65,7 +65,7 @@ GSPrivateSockaddrLength(struct sockaddr *addr)
|
|||
#ifdef AF_INET6
|
||||
case AF_INET6: return sizeof(struct sockaddr_in6);
|
||||
#endif
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
case AF_LOCAL: return sizeof(struct sockaddr_un);
|
||||
#endif
|
||||
default: return 0;
|
||||
|
@ -1236,7 +1236,7 @@ static NSString * const GSSOCKSAckConn = @"GSSOCKSAckConn";
|
|||
static inline BOOL
|
||||
socketError(int result)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
return (result == SOCKET_ERROR) ? YES : NO;
|
||||
#else
|
||||
return (result < 0) ? YES : NO;
|
||||
|
@ -1246,7 +1246,7 @@ socketError(int result)
|
|||
static inline BOOL
|
||||
socketWouldBlock()
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
int e = WSAGetLastError();
|
||||
return (e == WSAEWOULDBLOCK || e == WSAEINPROGRESS) ? YES : NO;
|
||||
#else
|
||||
|
@ -1258,7 +1258,7 @@ socketWouldBlock()
|
|||
static void
|
||||
setNonBlocking(SOCKET fd)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
unsigned long dummy = 1;
|
||||
|
||||
if (ioctlsocket(fd, FIONBIO, &dummy) == SOCKET_ERROR)
|
||||
|
@ -1298,7 +1298,7 @@ setNonBlocking(SOCKET fd)
|
|||
_sibling = nil;
|
||||
_closing = NO;
|
||||
_passive = NO;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
_loopID = WSA_INVALID_EVENT;
|
||||
#else
|
||||
_loopID = (void*)(intptr_t)-1;
|
||||
|
@ -1505,7 +1505,7 @@ setNonBlocking(SOCKET fd)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
case AF_LOCAL:
|
||||
{
|
||||
struct sockaddr_un peer;
|
||||
|
@ -1539,7 +1539,7 @@ setNonBlocking(SOCKET fd)
|
|||
|
||||
- (void) _setLoopID: (void *)ref
|
||||
{
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
_sock = (SOCKET)(intptr_t)ref; // On gnu/linux _sock is _loopID
|
||||
#endif
|
||||
_loopID = ref;
|
||||
|
@ -1570,7 +1570,7 @@ setNonBlocking(SOCKET fd)
|
|||
* monitored, and on mswindows systems we create an event object to be
|
||||
* monitored (the socket events are assoociated with this object later).
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
_loopID = CreateEvent(NULL, NO, NO, NULL);
|
||||
#else
|
||||
_loopID = (void*)(intptr_t)sock; // On gnu/linux _sock is _loopID
|
||||
|
@ -1666,7 +1666,7 @@ setNonBlocking(SOCKET fd)
|
|||
* indication of opened
|
||||
*/
|
||||
[self _setStatus: NSStreamStatusOpening];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEventSelect(_sock, _loopID, FD_ALL_EVENTS);
|
||||
#endif
|
||||
if (NSCountMapTable(_loops) > 0)
|
||||
|
@ -1700,7 +1700,7 @@ setNonBlocking(SOCKET fd)
|
|||
}
|
||||
|
||||
open_ok:
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEventSelect(_sock, _loopID, FD_ALL_EVENTS);
|
||||
#endif
|
||||
[super open];
|
||||
|
@ -1721,7 +1721,7 @@ setNonBlocking(SOCKET fd)
|
|||
return;
|
||||
}
|
||||
[_handler bye];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (_sibling && [_sibling streamStatus] != NSStreamStatusClosed)
|
||||
{
|
||||
/*
|
||||
|
@ -1790,7 +1790,7 @@ setNonBlocking(SOCKET fd)
|
|||
}
|
||||
else
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
readLen = recv([self _sock], (char*) buffer, (socklen_t) len, 0);
|
||||
#else
|
||||
readLen = read([self _sock], buffer, len);
|
||||
|
@ -1844,7 +1844,7 @@ setNonBlocking(SOCKET fd)
|
|||
|
||||
- (void) _dispatch
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
AUTORELEASE(RETAIN(self));
|
||||
/*
|
||||
* Windows only permits a single event to be associated with a socket
|
||||
|
@ -1999,7 +1999,7 @@ setNonBlocking(SOCKET fd)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (BOOL) runLoopShouldBlock: (BOOL*)trigger
|
||||
{
|
||||
*trigger = YES;
|
||||
|
@ -2037,7 +2037,7 @@ setNonBlocking(SOCKET fd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
writeLen = send([self _sock], (char*) buffer, (socklen_t) len, 0);
|
||||
#else
|
||||
writeLen = write([self _sock], buffer, (socklen_t) len);
|
||||
|
@ -2138,7 +2138,7 @@ setNonBlocking(SOCKET fd)
|
|||
* indication of opened
|
||||
*/
|
||||
[self _setStatus: NSStreamStatusOpening];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEventSelect(_sock, _loopID, FD_ALL_EVENTS);
|
||||
#endif
|
||||
if (NSCountMapTable(_loops) > 0)
|
||||
|
@ -2172,7 +2172,7 @@ setNonBlocking(SOCKET fd)
|
|||
}
|
||||
|
||||
open_ok:
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEventSelect(_sock, _loopID, FD_ALL_EVENTS);
|
||||
#endif
|
||||
[super open];
|
||||
|
@ -2195,7 +2195,7 @@ setNonBlocking(SOCKET fd)
|
|||
return;
|
||||
}
|
||||
[_handler bye];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (_sibling && [_sibling streamStatus] != NSStreamStatusClosed)
|
||||
{
|
||||
/*
|
||||
|
@ -2250,7 +2250,7 @@ setNonBlocking(SOCKET fd)
|
|||
|
||||
- (void) _dispatch
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
AUTORELEASE(RETAIN(self));
|
||||
/*
|
||||
* Windows only permits a single event to be associated with a socket
|
||||
|
@ -2403,7 +2403,7 @@ setNonBlocking(SOCKET fd)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (BOOL) runLoopShouldBlock: (BOOL*)trigger
|
||||
{
|
||||
*trigger = YES;
|
||||
|
@ -2506,7 +2506,7 @@ setNonBlocking(SOCKET fd)
|
|||
[self _sendEvent: NSStreamEventErrorOccurred];
|
||||
return;
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEventSelect(_sock, _loopID, FD_ALL_EVENTS);
|
||||
#endif
|
||||
[super open];
|
||||
|
@ -2514,7 +2514,7 @@ setNonBlocking(SOCKET fd)
|
|||
|
||||
- (void) close
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (_loopID != WSA_INVALID_EVENT)
|
||||
{
|
||||
WSACloseEvent(_loopID);
|
||||
|
@ -2582,7 +2582,7 @@ setNonBlocking(SOCKET fd)
|
|||
|
||||
- (void) _dispatch
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSANETWORKEVENTS events;
|
||||
|
||||
if (WSAEnumNetworkEvents(_sock, _loopID, &events) == SOCKET_ERROR)
|
||||
|
|
|
@ -89,7 +89,7 @@ NSString * const NSStreamSOCKSProxyVersionKey
|
|||
*/
|
||||
static RunLoopEventType typeForStream(NSStream *aStream)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if ([aStream _loopID] == (void*)aStream)
|
||||
{
|
||||
return ET_TRIGGER;
|
||||
|
|
|
@ -174,7 +174,7 @@ AbsolutePathOfExecutable(NSString *path, BOOL atLaunch)
|
|||
{
|
||||
pathlist = [env objectForKey:@"Path"];
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
patharr = [pathlist componentsSeparatedByString:@";"];
|
||||
#else
|
||||
patharr = [pathlist componentsSeparatedByString:@":"];
|
||||
|
@ -327,7 +327,7 @@ bundle_object_name(NSString *path, NSString* executable)
|
|||
return path1;
|
||||
else if ([mgr isReadableFileAtPath: path0] == YES)
|
||||
return path0;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* If we couldn't find the binary, and we are on windows, and the name
|
||||
* has no path extension, then let's try looking for a dll.
|
||||
*/
|
||||
|
@ -592,7 +592,7 @@ _find_main_bundle_for_tool(NSString *toolName)
|
|||
{
|
||||
bundlePath = [bundlePath stringByDeletingLastPathComponent];
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* On windows, the library (dll) is in the Tools area rather than
|
||||
* in the framework, so we can adjust the path here.
|
||||
*/
|
||||
|
@ -626,7 +626,7 @@ _find_main_bundle_for_tool(NSString *toolName)
|
|||
if (bundlePath)
|
||||
bundle = [[self alloc] initWithPath: bundlePath];
|
||||
}
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ IF_NO_GC(
|
|||
NSWarnMLog(@"NSBundle -initWithPath: requires absolute path names, "
|
||||
@"given '%@'", path);
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if ([path length] > 0 &&
|
||||
([path characterAtIndex: 0]=='/' || [path characterAtIndex: 0]=='\\'))
|
||||
{
|
||||
|
@ -1756,7 +1756,7 @@ IF_NO_GC(
|
|||
{
|
||||
NSString *rootPath;
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
if (_frameworkVersion)
|
||||
rootPath = [NSString stringWithFormat:@"%@/Versions/%@", [self bundlePath],
|
||||
_frameworkVersion];
|
||||
|
@ -2176,7 +2176,7 @@ IF_NO_GC(
|
|||
mangledName = [mangledName stringByReplacingString: @"+"
|
||||
withString: @"_1"];
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
path = [_path stringByAppendingPathComponent:@"Versions/Current"];
|
||||
#else
|
||||
path = _path;
|
||||
|
@ -2204,7 +2204,7 @@ IF_NO_GC(
|
|||
|
||||
if (_bundleType == NSBUNDLE_FRAMEWORK)
|
||||
{
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
return [_path stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"Versions/%@/Resources",
|
||||
version]];
|
||||
|
@ -2255,7 +2255,7 @@ IF_NO_GC(
|
|||
|
||||
if (_bundleType == NSBUNDLE_FRAMEWORK)
|
||||
{
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
return [_path stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"Versions/%@/PlugIns",
|
||||
version]];
|
||||
|
@ -2319,7 +2319,7 @@ IF_NO_GC(
|
|||
*/
|
||||
libraryName = [libraryName lastPathComponent];
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* A dll is usually of the form 'xxx-maj_min.dll'
|
||||
* so we can extract the version info and use it.
|
||||
*/
|
||||
|
|
|
@ -287,7 +287,7 @@ NSTimeInterval
|
|||
GSTimeNow(void)
|
||||
{
|
||||
NSTimeInterval t;
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
struct timeval tp;
|
||||
|
||||
gettimeofday (&tp, NULL);
|
||||
|
@ -335,7 +335,7 @@ GSTimeNow(void)
|
|||
GetSystemTime(&sys_time);
|
||||
t = GSTime(sys_time.wDay, sys_time.wMonth, sys_time.wYear, sys_time.wHour,
|
||||
sys_time.wMinute, sys_time.wSecond, sys_time.wMilliseconds);
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
return t;
|
||||
}
|
||||
|
|
|
@ -1257,7 +1257,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
/*
|
||||
* Make sure we are not registered.
|
||||
*/
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
if ([IreceivePort isKindOfClass: [NSMessagePort class]])
|
||||
{
|
||||
[self registerName: nil
|
||||
|
@ -1764,7 +1764,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
- (void) setRootObject: (id)anObj
|
||||
{
|
||||
setRootObjectForInPort(anObj, IreceivePort);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* On ms-windows, the operating system does not inform us when the remote
|
||||
* client of a message port goes away ... so we need to enable keepalive
|
||||
* to detect that condition.
|
||||
|
|
|
@ -137,7 +137,7 @@ static IMP appendImp;
|
|||
static BOOL
|
||||
readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
const unichar *thePath = 0;
|
||||
#else
|
||||
const char *thePath = 0;
|
||||
|
@ -147,7 +147,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
int c;
|
||||
long fileLength;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
thePath = (const unichar*)[path fileSystemRepresentation];
|
||||
#else
|
||||
thePath = [path fileSystemRepresentation];
|
||||
|
@ -158,7 +158,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
return NO;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
theFile = _wfopen(thePath, L"rb");
|
||||
#else
|
||||
theFile = fopen(thePath, "rb");
|
||||
|
@ -1295,7 +1295,7 @@ failure:
|
|||
options: (NSUInteger)writeOptionsMask
|
||||
error: (NSError **)errorPtr
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSUInteger length = [path length];
|
||||
unichar wthePath[length + 100];
|
||||
unichar wtheRealPath[length + 100];
|
||||
|
@ -1312,7 +1312,7 @@ failure:
|
|||
{
|
||||
useAuxiliaryFile = YES;
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
[path getCharacters: wtheRealPath];
|
||||
wtheRealPath[length] = L'\0';
|
||||
error_BadPath = (length <= 0);
|
||||
|
@ -1366,7 +1366,7 @@ failure:
|
|||
/* 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
|
||||
* the same filesystem and the subsequent rename() will work. */
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
wcscpy(wthePath, wtheRealPath);
|
||||
wcscat(wthePath, L"XXXXXX");
|
||||
if (_wmktemp(wthePath) == 0)
|
||||
|
@ -1388,7 +1388,7 @@ failure:
|
|||
}
|
||||
else
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
wcscpy(wthePath,wtheRealPath);
|
||||
#else
|
||||
strcpy(thePath, theRealPath);
|
||||
|
@ -1396,7 +1396,7 @@ failure:
|
|||
}
|
||||
|
||||
/* Open the file (whether temp or real) for writing. */
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
theFile = _wfopen(wthePath, L"wb");
|
||||
#else
|
||||
theFile = fopen(thePath, "wb");
|
||||
|
@ -1407,7 +1407,7 @@ failure:
|
|||
{
|
||||
/* Something went wrong; we weren't
|
||||
* even able to open the file. */
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSWarnMLog(@"Open (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
[NSError _last]);
|
||||
|
@ -1425,7 +1425,7 @@ failure:
|
|||
if (c < (int)[self length]) /* We failed to write everything for
|
||||
* some reason. */
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSWarnMLog(@"Fwrite (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
[NSError _last]);
|
||||
|
@ -1442,7 +1442,7 @@ failure:
|
|||
* closing the file, but we got here,
|
||||
* so we need to deal with it. */
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSWarnMLog(@"Fclose (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
[NSError _last]);
|
||||
|
@ -1459,7 +1459,7 @@ failure:
|
|||
{
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
NSMutableDictionary *att = nil;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSUInteger perm;
|
||||
#endif
|
||||
|
||||
|
@ -1470,7 +1470,7 @@ failure:
|
|||
IF_NO_GC(AUTORELEASE(att));
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* To replace the existing file on windows, it must be writable.
|
||||
*/
|
||||
perm = [att filePosixPermissions];
|
||||
|
@ -1539,7 +1539,7 @@ failure:
|
|||
#endif
|
||||
if (c != 0) /* Many things could go wrong, I guess. */
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSWarnMLog(@"Rename ('%@' to '%@') failed - %@",
|
||||
[NSString stringWithCharacters: wthePath
|
||||
length: wcslen(wthePath)],
|
||||
|
@ -1572,7 +1572,7 @@ failure:
|
|||
path);
|
||||
}
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
|
||||
{
|
||||
att = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
|
@ -1595,7 +1595,7 @@ failure:
|
|||
*/
|
||||
if (useAuxiliaryFile)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
_wunlink(wthePath);
|
||||
#else
|
||||
unlink(thePath);
|
||||
|
@ -3007,7 +3007,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
{
|
||||
int fd;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
const unichar *thePath = (const unichar*)[path filesystemRepresentation];
|
||||
#else
|
||||
const char *thePath = [path fileSystemRepresentation];
|
||||
|
@ -3020,7 +3020,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
return nil;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
fd = _wopen(thePath, _O_RDONLY);
|
||||
#else
|
||||
fd = open(thePath, O_RDONLY);
|
||||
|
|
|
@ -852,7 +852,7 @@ case a: env->addr = __builtin_return_address(a + 1); break;
|
|||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#ifndef SIGBUS
|
||||
#define SIGBUS SIGILL
|
||||
#endif
|
||||
|
|
|
@ -91,7 +91,7 @@ static NSUncaughtExceptionHandler *_NSUncaughtExceptionHandler = 0;
|
|||
#endif
|
||||
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#if defined(USE_BINUTILS)
|
||||
static NSString *
|
||||
GSPrivateBaseAddress(void *addr, void **base)
|
||||
|
@ -119,7 +119,7 @@ GSPrivateBaseAddress(void *addr, void **base)
|
|||
return nil;
|
||||
}
|
||||
#endif /* USE_BINUTILS */
|
||||
#else /* __MINGW32__ */
|
||||
#else /* __MINGW__ */
|
||||
|
||||
#ifndef GNU_SOURCE
|
||||
#define GNU_SOURCE
|
||||
|
@ -147,7 +147,7 @@ GSPrivateBaseAddress(void *addr, void **base)
|
|||
#endif
|
||||
}
|
||||
#endif /* USE_BINUTILS */
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#if defined(USE_BINUTILS)
|
||||
|
||||
|
@ -1101,7 +1101,7 @@ _NSAddHandler (NSHandler* handler)
|
|||
NSThread *thread;
|
||||
|
||||
thread = GSCurrentThread();
|
||||
#if defined(__MINGW32__) && defined(DEBUG)
|
||||
#if defined(__MINGW__) && defined(DEBUG)
|
||||
if (thread->_exception_handler
|
||||
&& IsBadReadPtr(thread->_exception_handler, sizeof(NSHandler)))
|
||||
{
|
||||
|
@ -1124,7 +1124,7 @@ _NSRemoveHandler (NSHandler* handler)
|
|||
fprintf(stderr, "ERROR: Removing exception handler that is not on top "
|
||||
"of the stack. (You probably called return in an NS_DURING block.)\n");
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (IsBadReadPtr(handler, sizeof(NSHandler)))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Could not remove exception handler, "
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <wchar.h>
|
||||
|
@ -97,7 +97,7 @@
|
|||
/* determine filesystem max path length */
|
||||
|
||||
#if defined(_POSIX_VERSION) || defined(__WIN32__)
|
||||
# if defined(__MINGW32__)
|
||||
# if defined(__MINGW__)
|
||||
# include <sys/utime.h>
|
||||
# else
|
||||
# include <utime.h>
|
||||
|
@ -186,7 +186,7 @@
|
|||
* Macros to handle unichar filesystem support.
|
||||
*/
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
|
||||
#define _CHMOD(A,B) _wchmod(A,B)
|
||||
#define _CLOSEDIR(A) _wclosedir(A)
|
||||
|
@ -376,7 +376,7 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
bundleClass = [NSBundle class];
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
return SetCurrentDirectoryW(lpath) == TRUE ? YES : NO;
|
||||
#else
|
||||
return (chdir(lpath) == 0) ? YES : NO;
|
||||
|
@ -403,7 +403,7 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
lpath = [defaultManager fileSystemRepresentationWithPath: path];
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
if (object_getClass(attributes) == GSAttrDictionaryClass)
|
||||
{
|
||||
num = ((GSAttrDictionary*)attributes)->statbuf.st_uid;
|
||||
|
@ -528,7 +528,7 @@ static NSStringEncoding defaultEncoding;
|
|||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
num = [attributes filePosixPermissions];
|
||||
if (num != NSNotFound)
|
||||
|
@ -740,7 +740,7 @@ static NSStringEncoding defaultEncoding;
|
|||
- (BOOL) createDirectoryAtPath: (NSString*)path
|
||||
attributes: (NSDictionary*)attributes
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSEnumerator *paths = [[path pathComponents] objectEnumerator];
|
||||
NSString *subPath;
|
||||
NSString *completePath = nil;
|
||||
|
@ -756,7 +756,7 @@ static NSStringEncoding defaultEncoding;
|
|||
if ([path length] == 0)
|
||||
return NO;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
while ((subPath = [paths nextObject]))
|
||||
{
|
||||
BOOL isDir = NO;
|
||||
|
@ -898,7 +898,7 @@ static NSStringEncoding defaultEncoding;
|
|||
contents: (NSData*)contents
|
||||
attributes: (NSDictionary*)attributes
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
const _CHAR *lpath = [self fileSystemRepresentationWithPath: path];
|
||||
HANDLE fh;
|
||||
DWORD written = 0;
|
||||
|
@ -914,7 +914,7 @@ static NSStringEncoding defaultEncoding;
|
|||
if ([path length] == 0)
|
||||
return NO;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
fh = CreateFileW(lpath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if (fh == INVALID_HANDLE_VALUE)
|
||||
|
@ -990,7 +990,7 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
NSString *currentDir = nil;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
int len = GetCurrentDirectoryW(0, 0);
|
||||
if (len > 0)
|
||||
{
|
||||
|
@ -1343,7 +1343,7 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
else
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
DWORD res;
|
||||
|
||||
res = GetFileAttributesW(lpath);
|
||||
|
@ -1373,7 +1373,7 @@ static NSStringEncoding defaultEncoding;
|
|||
|
||||
if (!is_dir)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (DeleteFileW(lpath) == FALSE)
|
||||
#else
|
||||
if (unlink(lpath) < 0)
|
||||
|
@ -1456,7 +1456,7 @@ static NSStringEncoding defaultEncoding;
|
|||
return NO;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
DWORD res;
|
||||
|
||||
|
@ -1510,7 +1510,7 @@ static NSStringEncoding defaultEncoding;
|
|||
return NO;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
DWORD res;
|
||||
|
||||
|
@ -1546,7 +1546,7 @@ static NSStringEncoding defaultEncoding;
|
|||
return NO;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
DWORD res;
|
||||
|
||||
|
@ -1587,7 +1587,7 @@ static NSStringEncoding defaultEncoding;
|
|||
return NO;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
DWORD res;
|
||||
|
||||
|
@ -1634,7 +1634,7 @@ static NSStringEncoding defaultEncoding;
|
|||
return NO;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
// TODO - handle directories
|
||||
{
|
||||
DWORD res;
|
||||
|
@ -1766,7 +1766,7 @@ static NSStringEncoding defaultEncoding;
|
|||
*/
|
||||
- (NSDictionary*) fileSystemAttributesAtPath: (NSString*)path
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
unsigned long long totalsize, freesize;
|
||||
id values[5];
|
||||
id keys[5] = {
|
||||
|
@ -2023,7 +2023,7 @@ static NSStringEncoding defaultEncoding;
|
|||
#endif
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (const GSNativeChar*) fileSystemRepresentationWithPath: (NSString*)path
|
||||
{
|
||||
if (path != nil && [path rangeOfString: @"/"].length > 0)
|
||||
|
@ -2234,7 +2234,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
|
||||
if (dirbuf)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* Skip "." and ".." directory entries */
|
||||
if (wcscmp(dirbuf->d_name, L".") == 0
|
||||
|| wcscmp(dirbuf->d_name, L"..") == 0)
|
||||
|
@ -2269,7 +2269,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
{
|
||||
// Do not follow links
|
||||
#ifdef S_IFLNK
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#warning "lstat does not support unichars"
|
||||
#else
|
||||
if (!_flags.isFollowing)
|
||||
|
@ -2504,7 +2504,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
toFile: (NSString*)destination
|
||||
handler: (id)handler
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (CopyFileW([self fileSystemRepresentationWithPath: source],
|
||||
[self fileSystemRepresentationWithPath: destination], NO))
|
||||
{
|
||||
|
@ -2866,7 +2866,7 @@ static NSSet *fileKeys = nil;
|
|||
d = (GSAttrDictionary*)NSAllocateObject(self, (l+1)*sizeof(_CHAR),
|
||||
NSDefaultMallocZone());
|
||||
|
||||
#if defined(S_IFLNK) && !defined(__MINGW32__)
|
||||
#if defined(S_IFLNK) && !defined(__MINGW__)
|
||||
if (traverse == NO)
|
||||
{
|
||||
if (lstat(lpath, &d->statbuf) != 0)
|
||||
|
@ -2949,7 +2949,7 @@ static NSSet *fileKeys = nil;
|
|||
{
|
||||
NSString *group = @"UnknownGroup";
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
DWORD returnCode = 0;
|
||||
PSID sidOwner;
|
||||
BOOL result = TRUE;
|
||||
|
@ -3106,7 +3106,7 @@ static NSSet *fileKeys = nil;
|
|||
{
|
||||
NSString *owner = @"UnknownUser";
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
DWORD returnCode = 0;
|
||||
PSID sidOwner;
|
||||
BOOL result = TRUE;
|
||||
|
@ -3236,7 +3236,7 @@ static NSSet *fileKeys = nil;
|
|||
|
||||
- (NSUInteger) fileSystemNumber
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
DWORD volumeSerialNumber = 0;
|
||||
_CHAR volumePathName[128];
|
||||
if (GetVolumePathNameW(_path,volumePathName,128))
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#import "Foundation/NSSet.h"
|
||||
#import "Foundation/NSCoder.h"
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <netdb.h>
|
||||
|
@ -48,7 +48,7 @@
|
|||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif /* !__MINGW32__*/
|
||||
#endif /* !__MINGW__*/
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE -1
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
{
|
||||
#if defined(HAVE_MMAP)
|
||||
munmap(buffer, size);
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW__)
|
||||
VirtualFree(buffer, 0, MEM_RELEASE);
|
||||
#else
|
||||
free(buffer);
|
||||
|
@ -100,7 +100,7 @@
|
|||
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
||||
#endif /* HAVE_MPROTECT */
|
||||
if (buffer == (void*)-1) buffer = (void*)0;
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW__)
|
||||
buffer = VirtualAlloc(NULL, _size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
|
||||
#else
|
||||
buffer = malloc(_size);
|
||||
|
@ -125,7 +125,7 @@
|
|||
*/
|
||||
- (void) protect
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
DWORD old;
|
||||
if (VirtualProtect(buffer, size, PAGE_EXECUTE, &old) == 0)
|
||||
{
|
||||
|
|
|
@ -108,7 +108,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
|||
NSData *d;
|
||||
const char *buf;
|
||||
unsigned len;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
LPCWSTR null_terminated_buf;
|
||||
#else
|
||||
#if defined(HAVE_SYSLOG)
|
||||
|
@ -139,7 +139,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
|||
len = [d length];
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
null_terminated_buf = UNISTR(message);
|
||||
|
||||
OutputDebugStringW(null_terminated_buf);
|
||||
|
@ -184,7 +184,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
|||
#else
|
||||
write(_NSLogDescriptor, buf, len);
|
||||
#endif
|
||||
#endif // __MINGW32__
|
||||
#endif // __MINGW__
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -294,7 +294,7 @@ NSLogv (NSString* format, va_list args)
|
|||
|
||||
if (pid == 0)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
pid = (int)GetCurrentProcessId();
|
||||
#else
|
||||
pid = (int)getpid();
|
||||
|
|
|
@ -190,7 +190,7 @@ static void GSLogZombie(id o, SEL sel)
|
|||
#undef GSATOMICREAD
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#ifndef _WIN64
|
||||
#undef InterlockedIncrement
|
||||
#undef InterlockedDecrement
|
||||
|
@ -899,14 +899,14 @@ GSGarbageCollectorLog(char *msg, GC_word arg)
|
|||
* Semi-private function in libobjc2 that initialises the classes used for
|
||||
* blocks.
|
||||
*/
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
BOOL
|
||||
objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
||||
#endif
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
/* When NSObject is loaded, register it as the superclass of the block
|
||||
* classes */
|
||||
if (objc_create_block_classes_as_subclasses_of)
|
||||
|
@ -933,13 +933,13 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
GC_set_warn_proc(GSGarbageCollectorLog);
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
{
|
||||
// See libgnustep-base-entry.m
|
||||
extern void gnustep_base_socket_init(void);
|
||||
gnustep_base_socket_init();
|
||||
}
|
||||
#else /* __MINGW32__ */
|
||||
#else /* __MINGW__ */
|
||||
|
||||
#ifdef SIGPIPE
|
||||
/*
|
||||
|
@ -981,7 +981,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
}
|
||||
#endif /* HAVE_SIGACTION */
|
||||
#endif /* SIGPIPE */
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#if GS_WITH_GC
|
||||
finalize_sel = @selector(finalize);
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#include <malloc.h>
|
||||
static size_t
|
||||
getpagesize(void)
|
||||
|
@ -136,7 +136,7 @@ NSRealMemoryAvailable ()
|
|||
if ((sysinfo(&info)) != 0)
|
||||
return 0;
|
||||
return info.freeram;
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW__)
|
||||
MEMORYSTATUSEX memory;
|
||||
|
||||
memory.dwLength = sizeof(memory);
|
||||
|
|
|
@ -119,7 +119,7 @@ static NSString *gnustep_is_flattened =
|
|||
nil;
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
|
||||
#include <lmaccess.h>
|
||||
|
||||
|
@ -712,7 +712,7 @@ GNUstepConfig(NSDictionary *newConfig)
|
|||
if (([attributes filePosixPermissions]
|
||||
& (0022 & ATTRMASK)) != 0)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
fprintf(stderr,
|
||||
"The file '%S' is writable by someone other than"
|
||||
" its owner (permissions 0%lo).\nIgnoring it.\n",
|
||||
|
@ -1009,7 +1009,7 @@ ParseConfigurationFile(NSString *fileName, NSMutableDictionary *dict,
|
|||
|
||||
if ([userName isEqual: fileOwner] == NO)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
fprintf(stderr, "The file '%S' is owned by '%s' but we expect it"
|
||||
" to be the personal config file of '%s'.\nIgnoring it.\n",
|
||||
[fileName fileSystemRepresentation],
|
||||
|
@ -1025,7 +1025,7 @@ ParseConfigurationFile(NSString *fileName, NSMutableDictionary *dict,
|
|||
}
|
||||
if (([attributes filePosixPermissions] & (0022 & ATTRMASK)) != 0)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
fprintf(stderr, "The file '%S' is writable by someone other than"
|
||||
" its owner (permissions 0%lo).\nIgnoring it.\n",
|
||||
[fileName fileSystemRepresentation],
|
||||
|
@ -1315,7 +1315,7 @@ GSSetUserName(NSString *aName)
|
|||
NSString *
|
||||
NSUserName(void)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (theUserName == nil)
|
||||
{
|
||||
/* Use the LOGNAME environment variable if set. */
|
||||
|
@ -1411,7 +1411,7 @@ NSHomeDirectoryForUser(NSString *loginName)
|
|||
{
|
||||
NSString *s = nil;
|
||||
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
#if defined(HAVE_GETPWNAM_R)
|
||||
struct passwd pw;
|
||||
struct passwd *p;
|
||||
|
@ -1484,7 +1484,7 @@ NSFullUserName(void)
|
|||
if (theFullUserName == nil)
|
||||
{
|
||||
NSString *userName = nil;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
struct _USER_INFO_2 *userInfo;
|
||||
|
||||
if (NetUserGetInfo(NULL, (unichar*)[NSUserName() cStringUsingEncoding:
|
||||
|
@ -1559,7 +1559,7 @@ GSDefaultsRootForUser(NSString *userName)
|
|||
defaultsDir = @GNUSTEP_TARGET_USER_DEFAULTS_DIR;
|
||||
}
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if ([defaultsDir rangeOfString: @":REGISTRY:"].length > 0)
|
||||
{
|
||||
return defaultsDir; // Just use windows registry.
|
||||
|
@ -1594,7 +1594,7 @@ NSTemporaryDirectory(void)
|
|||
int perm;
|
||||
int owner;
|
||||
BOOL flag;
|
||||
#if !defined(__MINGW32__)
|
||||
#if !defined(__MINGW__)
|
||||
int uid;
|
||||
#else
|
||||
unichar buffer[1024];
|
||||
|
@ -1623,7 +1623,7 @@ NSTemporaryDirectory(void)
|
|||
{
|
||||
#if defined(__CYGWIN__)
|
||||
baseTempDirName = @"/cygdrive/c/";
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW__)
|
||||
baseTempDirName = @"C:\\";
|
||||
#elif defined(__APPLE__)
|
||||
/*
|
||||
|
@ -1662,9 +1662,9 @@ NSTemporaryDirectory(void)
|
|||
perm = perm & 0777;
|
||||
|
||||
// Mateu Batle: secure temporary directories don't work in MinGW
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
uid = owner;
|
||||
#else
|
||||
#ifdef HAVE_GETEUID
|
||||
|
@ -1734,7 +1734,7 @@ NSOpenStepRootDirectory(void)
|
|||
|
||||
#if defined(__CYGWIN__)
|
||||
root = @"/cygdrive/c/";
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW__)
|
||||
root = @"C:\\";
|
||||
#else
|
||||
root = @"/";
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
int p[2];
|
||||
|
||||
if (pipe(p) == 0)
|
||||
|
|
|
@ -243,7 +243,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
}
|
||||
else
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
unichar *buffer;
|
||||
int buffer_size = 0;
|
||||
int needed_size = 0;
|
||||
|
@ -285,7 +285,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
/* Getting the process name */
|
||||
IF_NO_GC(RELEASE(_gnu_processName));
|
||||
_gnu_processName = [arg0 lastPathComponent];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* On windows we remove any .exe extension for consistency with app names
|
||||
* under unix
|
||||
*/
|
||||
|
@ -301,7 +301,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
IF_NO_GC(RETAIN(_gnu_processName));
|
||||
|
||||
/* Copy the argument list */
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
unichar **argvw = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
NSString *str;
|
||||
|
@ -365,7 +365,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
NSMutableArray *values = [NSMutableArray new];
|
||||
NSStringEncoding enc = GSPrivateDefaultCStringEncoding();
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (fallbackInitialisation == NO)
|
||||
{
|
||||
unichar *base;
|
||||
|
@ -852,7 +852,7 @@ _gnu_noobjc_free_vars(void)
|
|||
}
|
||||
#else /*! HAVE_PROCFS !HAVE_LOAD_METHOD !HAVE_KVM_ENV */
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
/* For WindowsAPI Library, we know the global variables (argc, etc) */
|
||||
+ (void) initialize
|
||||
{
|
||||
|
@ -889,7 +889,7 @@ int main(int argc, char *argv[], char *env[])
|
|||
sizeof(_NSConstantStringClassReference));
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSADATA lpWSAData;
|
||||
|
||||
// Initialize Windows Sockets
|
||||
|
@ -898,7 +898,7 @@ int main(int argc, char *argv[], char *env[])
|
|||
printf("Could not startup Windows Sockets\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#ifdef __MS_WIN__
|
||||
_MB_init_runtime();
|
||||
|
@ -910,7 +910,7 @@ int main(int argc, char *argv[], char *env[])
|
|||
return gnustep_base_user_main(argc, argv, env);
|
||||
}
|
||||
#endif /* !GS_PASS_ARGUMENTS */
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#endif /* HAS_LOAD_METHOD && HAS_PROCFS */
|
||||
|
||||
|
@ -952,7 +952,7 @@ int main(int argc, char *argv[], char *env[])
|
|||
{
|
||||
if (pid > 0)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION,0,pid);
|
||||
if (h == NULL && GetLastError() != ERROR_ACCESS_DENIED)
|
||||
{
|
||||
|
@ -1023,7 +1023,7 @@ static void determineOperatingSystem()
|
|||
NSString *os = nil;
|
||||
BOOL parseOS = YES;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
OSVERSIONINFOW osver;
|
||||
|
||||
osver.dwOSVersionInfoSize = sizeof(osver);
|
||||
|
@ -1065,7 +1065,7 @@ static void determineOperatingSystem()
|
|||
}
|
||||
}
|
||||
#endif /* HAVE_SYS_UTSNAME_H */
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
if (_operatingSystemVersion == nil)
|
||||
{
|
||||
|
@ -1183,7 +1183,7 @@ static void determineOperatingSystem()
|
|||
{
|
||||
int pid;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
pid = (int)GetCurrentProcessId();
|
||||
#else
|
||||
pid = (int)getpid();
|
||||
|
@ -1213,7 +1213,7 @@ static void determineOperatingSystem()
|
|||
|
||||
if (beenHere == NO)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
SYSTEM_INFO info;
|
||||
|
||||
GetSystemInfo(&info);
|
||||
|
@ -1269,7 +1269,7 @@ static void determineOperatingSystem()
|
|||
|
||||
- (NSUInteger) activeProcessorCount
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
SYSTEM_INFO info;
|
||||
int index;
|
||||
int count = 0;
|
||||
|
@ -1310,7 +1310,7 @@ static void determineOperatingSystem()
|
|||
|
||||
if (beenHere == NO)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
MEMORYSTATUSEX memory;
|
||||
|
||||
memory.dwLength = sizeof(memory);
|
||||
|
@ -1391,7 +1391,7 @@ GSInitializeProcess(int argc, char **argv, char **envp)
|
|||
extern int _NSLogDescriptor;
|
||||
int desc;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
desc = _wopen([path fileSystemRepresentation], O_RDWR|O_CREAT|O_APPEND, 0644);
|
||||
#else
|
||||
desc = open([path fileSystemRepresentation], O_RDWR|O_CREAT|O_APPEND, 0644);
|
||||
|
|
|
@ -52,19 +52,19 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#define close closesocket
|
||||
#else
|
||||
#include <sys/param.h> /* for MAXHOSTNAMELEN */
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h> /* for inet_ntoa() */
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
#include <errno.h>
|
||||
#include <string.h> /* for strchr() */
|
||||
#include <ctype.h> /* for strchr() */
|
||||
#include <fcntl.h>
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#include <winsock2.h>
|
||||
#include <wininet.h>
|
||||
#include <process.h>
|
||||
|
@ -101,7 +101,7 @@
|
|||
#define SOCKET_ERROR -1
|
||||
#define INVALID_SOCKET -1
|
||||
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
|
||||
/*
|
||||
* Largest chunk of data possible in DO
|
||||
|
@ -202,7 +202,7 @@ typedef enum {
|
|||
unsigned nItems; /* Number of items to be read. */
|
||||
GSHandleState state; /* State of the handle. */
|
||||
unsigned int addrNum; /* Address number within host. */
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
WSAEVENT event; /* Win32 event associated to socket */
|
||||
WSAEVENT eventTemp; /* Win32 event for asynchronous */
|
||||
@public
|
||||
|
@ -223,7 +223,7 @@ typedef enum {
|
|||
+ (GSTcpHandle*) handleWithDescriptor: (SOCKET)d;
|
||||
- (BOOL) connectToPort: (NSSocketPort*)aPort beforeDate: (NSDate*)when;
|
||||
- (int) descriptor;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (int) eventHandle;
|
||||
#endif
|
||||
- (void) invalidate;
|
||||
|
@ -369,13 +369,13 @@ static Class runLoopClass;
|
|||
+ (GSTcpHandle*) handleWithDescriptor: (SOCKET)d
|
||||
{
|
||||
GSTcpHandle *handle;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
unsigned long dummy;
|
||||
#else
|
||||
int e;
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
WSAEVENT ev;
|
||||
int rc;
|
||||
#endif
|
||||
|
@ -385,7 +385,7 @@ static Class runLoopClass;
|
|||
NSLog(@"illegal descriptor (%d) for Tcp Handle", d);
|
||||
return nil;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR)
|
||||
{
|
||||
|
@ -393,7 +393,7 @@ static Class runLoopClass;
|
|||
d, [NSError _last]);
|
||||
return nil;
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
#else /* !__MINGW__ */
|
||||
if ((e = fcntl(d, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
e |= NBLK_OPT;
|
||||
|
@ -416,7 +416,7 @@ static Class runLoopClass;
|
|||
handle->wMsgs = [NSMutableArray new];
|
||||
handle->myLock = [GSLazyRecursiveLock new];
|
||||
handle->valid = YES;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
ev = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL);
|
||||
if (ev == WSA_INVALID_EVENT)
|
||||
{
|
||||
|
@ -437,7 +437,7 @@ static Class runLoopClass;
|
|||
{
|
||||
if (self == [GSTcpHandle class])
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
|
||||
|
@ -538,7 +538,7 @@ static Class runLoopClass;
|
|||
if (connect(desc, (struct sockaddr*)&sockAddr, sizeof(sockAddr))
|
||||
== SOCKET_ERROR)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EINPROGRESS)
|
||||
|
@ -565,7 +565,7 @@ static Class runLoopClass;
|
|||
|
||||
state = GS_H_TRYCON;
|
||||
l = [NSRunLoop currentRunLoop];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSAssert(event != WSA_INVALID_EVENT, @"Socket without win32 event!");
|
||||
[l addEvent: (void*)(uintptr_t)event
|
||||
type: ET_HANDLE
|
||||
|
@ -603,7 +603,7 @@ static Class runLoopClass;
|
|||
M_LOCK(myLock);
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
[l removeEvent: (void*)(uintptr_t)event
|
||||
type: ET_HANDLE
|
||||
forMode: NSConnectionReplyMode
|
||||
|
@ -694,7 +694,7 @@ static Class runLoopClass;
|
|||
return desc;
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (int) eventHandle
|
||||
{
|
||||
return (int) (size_t) event;
|
||||
|
@ -719,7 +719,7 @@ static Class runLoopClass;
|
|||
|
||||
valid = NO;
|
||||
l = [runLoopClass currentRunLoop];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
[l removeEvent: (void*)(uintptr_t)event
|
||||
type: ET_HANDLE
|
||||
forMode: nil
|
||||
|
@ -741,7 +741,7 @@ static Class runLoopClass;
|
|||
NSDebugMLLog(@"GSTcpHandle", @"invalidated 0x%x", self);
|
||||
[[self recvPort] removeHandle: self];
|
||||
[[self sendPort] removeHandle: self];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSACloseEvent(event);
|
||||
event = WSA_INVALID_EVENT;
|
||||
#endif
|
||||
|
@ -808,12 +808,12 @@ static Class runLoopClass;
|
|||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
else if (WSAGetLastError()!= WSAEINTR
|
||||
&& WSAGetLastError()!= WSAEWOULDBLOCK)
|
||||
#else
|
||||
else if (errno != EINTR && errno != EAGAIN)
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
{
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"read failed - %@ on 0x%p", [NSError _last], self);
|
||||
|
@ -1162,23 +1162,23 @@ static Class runLoopClass;
|
|||
res = send(desc, b + wLength, l - wLength, 0);
|
||||
if (res < 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError()!= WSAEINTR
|
||||
&& WSAGetLastError()!= WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EINTR && errno != EAGAIN)
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
{
|
||||
NSLog(@"write attempt failed - %@", [NSError _last]);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError()== WSAEWOULDBLOCK)
|
||||
{
|
||||
readyToSend = NO;
|
||||
}
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1223,7 +1223,7 @@ static Class runLoopClass;
|
|||
extra: (void*)extra
|
||||
forMode: (NSString*)mode
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSANETWORKEVENTS ocurredEvents;
|
||||
#else
|
||||
#endif
|
||||
|
@ -1235,7 +1235,7 @@ static Class runLoopClass;
|
|||
{
|
||||
NSRunLoop *l = [runLoopClass currentRunLoop];
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
[l removeEvent: data
|
||||
type: ET_HANDLE
|
||||
forMode: mode
|
||||
|
@ -1255,7 +1255,7 @@ static Class runLoopClass;
|
|||
|
||||
M_LOCK(myLock);
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (WSAEnumNetworkEvents(desc, event, &ocurredEvents)==SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"Error getting event type %d", WSAGetLastError());
|
||||
|
@ -1352,7 +1352,7 @@ static Class runLoopClass;
|
|||
|
||||
IF_NO_GC(RETAIN(self);)
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSAssert(event != WSA_INVALID_EVENT, @"Socket without win32 event!");
|
||||
[l addEvent: (void*)(uintptr_t)event
|
||||
type: ET_HANDLE
|
||||
|
@ -1387,7 +1387,7 @@ static Class runLoopClass;
|
|||
&& [when timeIntervalSinceNow] > 0)
|
||||
{
|
||||
M_UNLOCK(myLock);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (readyToSend)
|
||||
{
|
||||
[self receivedEventWrite];
|
||||
|
@ -1402,7 +1402,7 @@ static Class runLoopClass;
|
|||
M_LOCK(myLock);
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
[l removeEvent: (void*)(uintptr_t)event
|
||||
type: ET_HANDLE
|
||||
forMode: NSConnectionReplyMode
|
||||
|
@ -1583,7 +1583,7 @@ static Class tcpPortClass;
|
|||
port->address = [addr copy];
|
||||
port->handles = NSCreateMapTable(NSIntMapKeyCallBacks,
|
||||
NSObjectMapValueCallBacks, 0);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
port->eventListener = WSA_INVALID_EVENT;
|
||||
port->events = NSCreateMapTable(NSIntMapKeyCallBacks,
|
||||
NSIntMapValueCallBacks, 0);
|
||||
|
@ -1679,7 +1679,7 @@ static Class tcpPortClass;
|
|||
}
|
||||
else
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
int rc;
|
||||
#endif
|
||||
/*
|
||||
|
@ -1689,7 +1689,7 @@ static Class tcpPortClass;
|
|||
*/
|
||||
port->listener = desc;
|
||||
port->portNum = GSSwapBigI16ToHost(sockaddr.sin_port);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
port->eventListener = (WSAEVENT)CreateEvent(NULL,NO,NO,NULL);
|
||||
if (port->eventListener == WSA_INVALID_EVENT)
|
||||
{
|
||||
|
@ -1775,7 +1775,7 @@ static Class tcpPortClass;
|
|||
handle->recvPort = GS_GC_HIDE(self);
|
||||
}
|
||||
NSMapInsert(handles, (void*)(uintptr_t)[handle descriptor], (void*)handle);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSMapInsert(events, (void*)(uintptr_t)[handle eventHandle],
|
||||
(void*)(uintptr_t)[handle descriptor]);
|
||||
#endif
|
||||
|
@ -1827,7 +1827,7 @@ static Class tcpPortClass;
|
|||
* This is a callback method used by the NSRunLoop class to determine which
|
||||
* descriptors to watch for the port.
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (void) getFds: (int*)fds count: (int*)count
|
||||
{
|
||||
NSMapEnumerator me;
|
||||
|
@ -2072,7 +2072,7 @@ static Class tcpPortClass;
|
|||
{
|
||||
(void) close(listener);
|
||||
listener = -1;
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSACloseEvent(eventListener);
|
||||
eventListener = WSA_INVALID_EVENT;
|
||||
#endif
|
||||
|
@ -2089,7 +2089,7 @@ static Class tcpPortClass;
|
|||
[handle invalidate];
|
||||
}
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (events != 0)
|
||||
{
|
||||
NSFreeMapTable(events);
|
||||
|
@ -2132,7 +2132,7 @@ static Class tcpPortClass;
|
|||
extra: (void*)extra
|
||||
forMode: (NSString*)mode
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
WSAEVENT event = (WSAEVENT)extra;
|
||||
SOCKET desc;
|
||||
#else
|
||||
|
@ -2143,7 +2143,7 @@ static Class tcpPortClass;
|
|||
NSDebugMLLog(@"NSPort", @"received %s event %p on 0x%x",
|
||||
type == ET_RPORT ? "read" : "write", extra, self);
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (event == eventListener)
|
||||
#else
|
||||
if (desc == listener)
|
||||
|
@ -2163,7 +2163,7 @@ static Class tcpPortClass;
|
|||
|
||||
setsockopt(desc, SOL_SOCKET, SO_KEEPALIVE, (char*)&status,
|
||||
sizeof(status));
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
// reset associated event with new socket
|
||||
WSAEventSelect(desc, eventListener, 0);
|
||||
#endif
|
||||
|
@ -2184,7 +2184,7 @@ static Class tcpPortClass;
|
|||
else
|
||||
{
|
||||
M_LOCK(myLock);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
desc = (SOCKET)NSMapGet(events, (void*)(uintptr_t)event);
|
||||
#endif
|
||||
handle = (GSTcpHandle*)NSMapGet(handles, (void*)(uintptr_t)desc);
|
||||
|
@ -2194,7 +2194,7 @@ static Class tcpPortClass;
|
|||
{
|
||||
const char *t;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (type == ET_HANDLE) t = "winhandle";
|
||||
#else
|
||||
if (type == ET_RDESC) t = "rdesc";
|
||||
|
@ -2267,7 +2267,7 @@ static Class tcpPortClass;
|
|||
handle->recvPort = nil;
|
||||
}
|
||||
NSMapRemove(handles, (void*)(uintptr_t)[handle descriptor]);
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
NSMapRemove(events, (void*)(uintptr_t)[handle eventHandle]);
|
||||
#endif
|
||||
if (((int) listener) < 0 && NSCountMapTable(handles) == 0)
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
#import "GSPortPrivate.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#include <winsock2.h>
|
||||
#include <wininet.h>
|
||||
#else
|
||||
|
|
|
@ -3153,7 +3153,7 @@ handle_printf_atsign (FILE *stream,
|
|||
|
||||
static NSFileManager *fm = nil;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
- (const GSNativeChar*) fileSystemRepresentation
|
||||
{
|
||||
if (fm == nil)
|
||||
|
@ -3883,7 +3883,7 @@ static NSFileManager *fm = nil;
|
|||
|
||||
- (NSString*) stringByResolvingSymlinksInPath
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
return IMMUTABLE(self);
|
||||
#else
|
||||
#ifndef PATH_MAX
|
||||
|
@ -4050,7 +4050,7 @@ static NSFileManager *fm = nil;
|
|||
}
|
||||
return [[NSFileManager defaultManager]
|
||||
stringWithFileSystemRepresentation: newBuf length: strlen(newBuf)];
|
||||
#endif /* (__MINGW32__) */
|
||||
#endif /* (__MINGW__) */
|
||||
}
|
||||
|
||||
- (NSString*) stringByStandardizingPath
|
||||
|
@ -4161,7 +4161,7 @@ static NSFileManager *fm = nil;
|
|||
* For absolute paths, we must resolve symbolic links or (on MINGW)
|
||||
* remove '/../' sequences and their matching parent directories.
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* Condense `/../' */
|
||||
r = (NSRange){root, l-root};
|
||||
while ((r = [s rangeOfString: @".." options: 0 range: r]).length == 2)
|
||||
|
@ -4331,7 +4331,7 @@ static NSFileManager *fm = nil;
|
|||
*/
|
||||
if (c == pathSepChar())
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (GSPathHandlingUnix() == YES)
|
||||
{
|
||||
return YES;
|
||||
|
|
|
@ -119,12 +119,12 @@ static BOOL hadChildSignal = NO;
|
|||
static void handleSignal(int sig)
|
||||
{
|
||||
hadChildSignal = YES;
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
signal(SIGCHLD, handleSignal);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
@interface NSConcreteWindowsTask : NSTask
|
||||
{
|
||||
@public
|
||||
|
@ -264,7 +264,7 @@ pty_slave(const char* name)
|
|||
}
|
||||
[gnustep_global_lock unlock];
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
signal(SIGCHLD, handleSignal);
|
||||
#endif
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ pty_slave(const char* name)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#ifdef HAVE_KILLPG
|
||||
killpg(_taskId, SIGINT);
|
||||
#else
|
||||
|
@ -427,7 +427,7 @@ pty_slave(const char* name)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"NSTask - task has not yet launched"];
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#ifdef HAVE_KILLPG
|
||||
killpg(_taskId, SIGCONT);
|
||||
#else
|
||||
|
@ -618,7 +618,7 @@ pty_slave(const char* name)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"NSTask - task has not yet launched"];
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#ifdef HAVE_KILLPG
|
||||
killpg(_taskId, SIGSTOP);
|
||||
#else
|
||||
|
@ -650,7 +650,7 @@ pty_slave(const char* name)
|
|||
}
|
||||
|
||||
_hasTerminated = YES;
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#ifdef HAVE_KILLPG
|
||||
killpg(_taskId, SIGTERM);
|
||||
#else
|
||||
|
@ -751,7 +751,7 @@ pty_slave(const char* name)
|
|||
full_path = [arch_path stringByAppendingPathComponent: libs];
|
||||
|
||||
lpath = [full_path stringByAppendingPathComponent: prog];
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if ([mgr isExecutableFileAtPath: lpath] == NO
|
||||
&& [mgr isExecutableFileAtPath:
|
||||
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
|
||||
|
@ -760,7 +760,7 @@ pty_slave(const char* name)
|
|||
#endif
|
||||
{
|
||||
lpath = [arch_path stringByAppendingPathComponent: prog];
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if ([mgr isExecutableFileAtPath: lpath] == NO
|
||||
&& [mgr isExecutableFileAtPath:
|
||||
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
|
||||
|
@ -769,7 +769,7 @@ pty_slave(const char* name)
|
|||
#endif
|
||||
{
|
||||
lpath = [base_path stringByAppendingPathComponent: prog];
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if ([mgr isExecutableFileAtPath: lpath] == NO
|
||||
&& [mgr isExecutableFileAtPath:
|
||||
(lpath = [lpath stringByAppendingPathExtension: @"exe"])] == NO)
|
||||
|
@ -788,7 +788,7 @@ pty_slave(const char* name)
|
|||
}
|
||||
if (lpath != nil)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if ([mgr isExecutableFileAtPath: lpath] == NO
|
||||
&& [mgr isExecutableFileAtPath:
|
||||
(lpath = [lpath stringByAppendingPathExtension: @"exe"])]
|
||||
|
@ -816,7 +816,7 @@ pty_slave(const char* name)
|
|||
}
|
||||
lpath = [lpath stringByStandardizingPath];
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
/** We need this to be native windows format, and some of the standardisation
|
||||
* above may have left unix style separators in the string.
|
||||
*/
|
||||
|
@ -919,7 +919,7 @@ pty_slave(const char* name)
|
|||
|
||||
@end
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
@implementation NSConcreteWindowsTask
|
||||
|
||||
BOOL
|
||||
|
@ -1517,7 +1517,7 @@ GSPrivateCheckTasks()
|
|||
#endif
|
||||
#else
|
||||
#if defined(HAVE_SETPGID)
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
pid = (int)GetCurrentProcessId(),
|
||||
#else
|
||||
pid = (int)getpid();
|
||||
|
|
|
@ -202,7 +202,7 @@ GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when)
|
|||
while (delay > 30.0*60.0)
|
||||
{
|
||||
// sleep 30 minutes
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
Sleep (30*60*1000);
|
||||
#else
|
||||
sleep (30*60);
|
||||
|
@ -216,7 +216,7 @@ GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when)
|
|||
*/
|
||||
while (delay > 0)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#if defined(HAVE_USLEEP)
|
||||
/* On windows usleep() seems to perform a busy wait ... so we only
|
||||
* use it for short delays ... otherwise use the less accurate Sleep()
|
||||
|
@ -901,7 +901,7 @@ static void *nsthreadLauncher(void* thread)
|
|||
{
|
||||
[lock lock];
|
||||
[performers addObject: performer];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (SetEvent(event) == 0)
|
||||
{
|
||||
NSLog(@"Set event failed - %@", [NSError _last]);
|
||||
|
@ -925,7 +925,7 @@ static void *nsthreadLauncher(void* thread)
|
|||
|
||||
- (id) init
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if ((event = CreateEvent(NULL, TRUE, FALSE, NULL)) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DESTROY(self);
|
||||
|
@ -973,7 +973,7 @@ static void *nsthreadLauncher(void* thread)
|
|||
[lock lock];
|
||||
[performers makeObjectsPerformSelector: @selector(invalidate)];
|
||||
[performers removeAllObjects];
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (event != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(event);
|
||||
|
@ -1001,7 +1001,7 @@ static void *nsthreadLauncher(void* thread)
|
|||
unsigned int c;
|
||||
|
||||
[lock lock];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (event != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
if (ResetEvent(event) == 0)
|
||||
|
|
|
@ -203,7 +203,7 @@ typedef struct {
|
|||
}
|
||||
@end
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
@interface GSWindowsTimeZone : NSTimeZone
|
||||
{
|
||||
@public
|
||||
|
@ -467,7 +467,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
fileName = [NSTimeZoneClass _getTimeZoneFile: name];
|
||||
if (fileName == nil
|
||||
|| ![[NSFileManager defaultManager] fileExistsAtPath: fileName])
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
zone = [[GSWindowsTimeZone alloc] initWithName: name data: 0];
|
||||
DESTROY(self);
|
||||
|
@ -481,7 +481,7 @@ static NSString *_time_zone_path(NSString *subpath, NSString *type)
|
|||
#endif
|
||||
data = [NSData dataWithContentsOfFile: fileName];
|
||||
}
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (!data)
|
||||
zone = [[GSWindowsTimeZone alloc] initWithName: name data: data];
|
||||
else
|
||||
|
@ -1028,7 +1028,7 @@ static NSMapTable *absolutes = 0;
|
|||
path = _time_zone_path (ABBREV_MAP, nil);
|
||||
if (path != nil)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
unichar mode[3];
|
||||
|
||||
mode[0] = 'r';
|
||||
|
@ -1468,7 +1468,7 @@ static NSMapTable *absolutes = 0;
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/*
|
||||
* Try to get timezone from windows system call.
|
||||
*/
|
||||
|
@ -1559,7 +1559,7 @@ static NSMapTable *absolutes = 0;
|
|||
path = _time_zone_path (REGIONS_FILE, nil);
|
||||
if (path != nil)
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
unichar mode[3];
|
||||
|
||||
mode[0] = 'r';
|
||||
|
@ -2105,7 +2105,7 @@ static NSString *zoneDirs[] = {
|
|||
@end
|
||||
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* Timezone information data as stored in the registry */
|
||||
typedef struct TZI_format {
|
||||
LONG Bias;
|
||||
|
@ -2540,7 +2540,7 @@ GSBreakTime(NSTimeInterval when, NSInteger*year, NSInteger*month, NSInteger*day,
|
|||
return [self name];
|
||||
}
|
||||
@end
|
||||
#endif // __MINGW32__
|
||||
#endif // __MINGW__
|
||||
|
||||
|
||||
@implementation GSTimeZone
|
||||
|
|
|
@ -1296,7 +1296,7 @@ static unsigned urlAlign;
|
|||
|
||||
unescape(buf, buf);
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* On windows a file URL path may be of the form C:\xxx (ie we should
|
||||
* not insert the leading slash).
|
||||
* Also the vertical bar symbol may have been used instead of the
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#import "GNUstepBase/NSObject+GNUstepBase.h"
|
||||
#import "GNUstepBase/NSString+GNUstepBase.h"
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
@class NSUserDefaultsWin32;
|
||||
#endif
|
||||
|
||||
|
@ -517,7 +517,7 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
|
|||
NS_DURING
|
||||
{
|
||||
// Create new sharedDefaults (NOTE: Not added to the autorelease pool!)
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
{
|
||||
NSString *path = GSDefaultsRootForUser(NSUserName());
|
||||
NSRange r = [path rangeOfString: @":REGISTRY:"];
|
||||
|
@ -758,7 +758,7 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
|
|||
{
|
||||
currLang = [NSArray arrayWithObject: GSLanguageFromLocale(locale)];
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (currLang == nil && locale != nil)
|
||||
{
|
||||
/* Check for language as the first part of the locale string */
|
||||
|
@ -877,7 +877,7 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
|
|||
}
|
||||
|
||||
r = [path rangeOfString: @":INTERNAL:"];
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
if (r.length == 0)
|
||||
{
|
||||
r = [path rangeOfString: @":REGISTRY:"];
|
||||
|
|
|
@ -200,7 +200,7 @@ struct StackBlockClass {
|
|||
const char *types;
|
||||
};
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* FIXME ... evil hack ... declare symbol to avoid linker error on windows
|
||||
* where the compiler/linker doesn't support a weak reference.
|
||||
* This obviously breaks the code below...
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <ffi.h>
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/*
|
||||
* Avoid conflicts when other headers try to define UINT32 and UINT64
|
||||
*/
|
||||
|
|
|
@ -99,7 +99,7 @@ static int
|
|||
objc_initialize_loading(FILE *errorStream)
|
||||
{
|
||||
NSString *path;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
const unichar *fsPath;
|
||||
#else
|
||||
const char *fsPath;
|
||||
|
@ -142,7 +142,7 @@ objc_load_callback(Class class, struct objc_category * category)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#define FSCHAR unichar
|
||||
#else
|
||||
#define FSCHAR char
|
||||
|
@ -252,7 +252,7 @@ GSPrivateUnloadModule(FILE *errorStream,
|
|||
}
|
||||
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
NSString *
|
||||
GSPrivateSymbolPath(Class theClass, Category *theCategory)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#import "Foundation/NSUserDefaults.h"
|
||||
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#include "process.h"
|
||||
#endif
|
||||
|
||||
|
@ -1160,7 +1160,7 @@ main(int argc, char** argv, char** env)
|
|||
#endif
|
||||
signal(sym, ihandler);
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
signal(SIGTTIN, SIG_IGN);
|
||||
|
@ -1182,7 +1182,7 @@ main(int argc, char** argv, char** env)
|
|||
*/
|
||||
[[NSFileHandle fileHandleWithStandardInput] closeFile];
|
||||
[[NSFileHandle fileHandleWithStandardOutput] closeFile];
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
if (debugging == NO)
|
||||
{
|
||||
[[NSFileHandle fileHandleWithStandardError] closeFile];
|
||||
|
|
166
Tools/gdomap.c
166
Tools/gdomap.c
|
@ -30,19 +30,19 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h> /* for gethostname() */
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
#include <sys/param.h> /* for MAXHOSTNAMELEN */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h> /* for inet_ntoa() */
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <string.h> /* for strchr() */
|
||||
#include <ctype.h> /* for strchr() */
|
||||
#include <fcntl.h>
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#include <stdint.h>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
@ -91,7 +91,7 @@
|
|||
#if defined(__svr4__)
|
||||
#include <sys/stropts.h>
|
||||
#endif
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
|
||||
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
|
@ -101,7 +101,7 @@
|
|||
#if HAVE_STRERROR
|
||||
#define lastErr() strerror(errno)
|
||||
#else
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
static errbuf[BUFSIZ];
|
||||
#define lastErr() (sprintf(errbuf, "WSAGetLastError()=%d", WSAGetLastError()), errbuf)
|
||||
#else
|
||||
|
@ -143,7 +143,7 @@ static errbuf[BUFSIZ];
|
|||
__a*((__v+__a-1)/__a); })
|
||||
|
||||
typedef unsigned char *uptr;
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
static int is_daemon = 0; /* Currently running as daemon. */
|
||||
#endif
|
||||
static int debug = 0; /* Extra debug gdomap_logging. */
|
||||
|
@ -175,7 +175,7 @@ struct in_addr class_c_mask;
|
|||
* Predeclare some of the functions used.
|
||||
*/
|
||||
static void dump_stats();
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
static void dump_tables();
|
||||
#endif
|
||||
static void handle_accept();
|
||||
|
@ -196,7 +196,7 @@ static void queue_probe(struct in_addr* to, struct in_addr *from,
|
|||
|
||||
char *xgethostname (void);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
#ifndef HAVE_GETOPT
|
||||
/* A simple implementation of getopt() */
|
||||
|
||||
|
@ -392,11 +392,11 @@ static fd_set write_fds; /* Descriptors which are writable. */
|
|||
Bjoern Giesler <Bjoern.Giesler@gmx.de> to work on Win32. */
|
||||
|
||||
typedef struct {
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
SOCKET s;
|
||||
#else
|
||||
int s;
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
struct sockaddr_in addr; /* Address of process making request. */
|
||||
socklen_t pos; /* Position reading data. */
|
||||
union {
|
||||
|
@ -406,11 +406,11 @@ typedef struct {
|
|||
} RInfo; /* State of reading each request. */
|
||||
|
||||
typedef struct {
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
SOCKET s;
|
||||
#else
|
||||
int s;
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
int len; /* Length of data to be written. */
|
||||
int pos; /* Amount of data already written. */
|
||||
char* buf; /* Buffer for data. */
|
||||
|
@ -424,11 +424,11 @@ static unsigned _wInfoCapacity = 0;
|
|||
static unsigned _wInfoCount = 0;
|
||||
|
||||
static void
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
delRInfo(SOCKET s)
|
||||
#else
|
||||
delRInfo(int s)
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -456,7 +456,7 @@ delRInfo(int s)
|
|||
|
||||
|
||||
static RInfo *
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
getRInfo(SOCKET s, int make)
|
||||
#else
|
||||
getRInfo(int s, int make)
|
||||
|
@ -498,11 +498,11 @@ getRInfo(int s, int make)
|
|||
}
|
||||
|
||||
static void
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
delWInfo(SOCKET s)
|
||||
#else
|
||||
delWInfo(int s)
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
@ -530,7 +530,7 @@ delWInfo(int s)
|
|||
|
||||
|
||||
static WInfo *
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
getWInfo(SOCKET s, int make)
|
||||
#else
|
||||
getWInfo(int s, int make)
|
||||
|
@ -981,7 +981,7 @@ prb_tim(time_t when)
|
|||
static void
|
||||
clear_chan(int desc)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (desc != INVALID_SOCKET)
|
||||
#else
|
||||
if (desc >= 0 && desc < FD_SETSIZE)
|
||||
|
@ -997,7 +997,7 @@ clear_chan(int desc)
|
|||
else
|
||||
{
|
||||
FD_CLR(desc, &read_fds);
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -1053,7 +1053,7 @@ dump_stats()
|
|||
gdomap_log(LOG_INFO);
|
||||
}
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
static void
|
||||
dump_tables()
|
||||
{
|
||||
|
@ -1101,7 +1101,7 @@ dump_tables()
|
|||
static void
|
||||
init_iface()
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
INTERFACE_INFO InterfaceList[20];
|
||||
unsigned long nBytesReturned;
|
||||
int i, countActive, nNumInterfaces;
|
||||
|
@ -1669,9 +1669,9 @@ init_ports()
|
|||
{
|
||||
int r;
|
||||
struct sockaddr_in sa;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
unsigned long dummy;
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
/*
|
||||
* Now we set up the sockets to accept incoming connections and set
|
||||
|
@ -1680,7 +1680,7 @@ init_ports()
|
|||
*/
|
||||
|
||||
udp_desc = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (udp_desc == INVALID_SOCKET)
|
||||
#else
|
||||
if (udp_desc < 0)
|
||||
|
@ -1734,7 +1734,7 @@ init_ports()
|
|||
gdomap_log(LOG_WARNING);
|
||||
}
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(udp_desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
|
@ -1742,7 +1742,7 @@ init_ports()
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
#else /* !__MINGW__ */
|
||||
if ((r = fcntl(udp_desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
r |= NBLK_OPT;
|
||||
|
@ -1788,7 +1788,7 @@ init_ports()
|
|||
* Now we do the TCP socket.
|
||||
*/
|
||||
tcp_desc = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (tcp_desc == INVALID_SOCKET)
|
||||
#else
|
||||
if (tcp_desc < 0)
|
||||
|
@ -1834,7 +1834,7 @@ init_ports()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(tcp_desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
|
@ -1842,7 +1842,7 @@ init_ports()
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
#else /* !__MINGW__ */
|
||||
if ((r = fcntl(tcp_desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
r |= NBLK_OPT;
|
||||
|
@ -1859,7 +1859,7 @@ init_ports()
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
memset(&sa, '\0', sizeof(sa));
|
||||
sa.sin_family = AF_INET;
|
||||
|
@ -1900,7 +1900,7 @@ init_ports()
|
|||
FD_SET(tcp_desc, &read_fds);
|
||||
FD_SET(udp_desc, &read_fds);
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
/*
|
||||
* Turn off pipe signals so we don't get interrupted if we attempt
|
||||
* to write a response to a process which has died.
|
||||
|
@ -1910,7 +1910,7 @@ init_ports()
|
|||
* Enable table dumping to /tmp/gdomap.dump
|
||||
*/
|
||||
signal(SIGUSR1, dump_tables);
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
}
|
||||
|
||||
|
||||
|
@ -2217,11 +2217,11 @@ handle_accept()
|
|||
if (desc >= 0)
|
||||
{
|
||||
RInfo *ri;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
unsigned long dummy = 1;
|
||||
#else
|
||||
int r;
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
|
||||
FD_SET(desc, &read_fds);
|
||||
ri = getRInfo(desc, 1);
|
||||
|
@ -2237,7 +2237,7 @@ handle_accept()
|
|||
/*
|
||||
* Ensure that the connection is non-blocking.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (ioctlsocket(desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
if (debug)
|
||||
|
@ -2248,7 +2248,7 @@ handle_accept()
|
|||
}
|
||||
clear_chan(desc);
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
#else /* !__MINGW__ */
|
||||
if ((r = fcntl(desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
r |= NBLK_OPT;
|
||||
|
@ -2273,16 +2273,16 @@ handle_accept()
|
|||
}
|
||||
clear_chan(desc);
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
}
|
||||
else if (debug)
|
||||
{
|
||||
snprintf(ebuf, sizeof(ebuf), "accept failed - errno %d",
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
WSAGetLastError());
|
||||
#else
|
||||
errno);
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
|
@ -2406,7 +2406,7 @@ handle_io()
|
|||
/*
|
||||
* Got some descriptor activity - deal with it.
|
||||
*/
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
/* read file descriptors */
|
||||
for (i = 0; i < rfds.fd_count; i++)
|
||||
{
|
||||
|
@ -2438,7 +2438,7 @@ handle_io()
|
|||
handle_write(wfds.fd_array[i]);
|
||||
}
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
#else /* !__MINGW__ */
|
||||
for (i = 0; i < FD_SETSIZE; i++)
|
||||
{
|
||||
if (FD_ISSET(i, &rfds))
|
||||
|
@ -2472,7 +2472,7 @@ handle_io()
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2496,7 +2496,7 @@ handle_read(int desc)
|
|||
|
||||
while (ri->pos < GDO_REQ_SIZE && done == 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
r = recv(desc, (char *)&ptr[ri->pos],
|
||||
GDO_REQ_SIZE - ri->pos, 0);
|
||||
#else
|
||||
|
@ -2518,7 +2518,7 @@ handle_read(int desc)
|
|||
tcp_read++;
|
||||
handle_request(desc);
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
else if (WSAGetLastError() != WSAEWOULDBLOCK || nothingRead == 1)
|
||||
#else
|
||||
else if (errno != EWOULDBLOCK || nothingRead == 1)
|
||||
|
@ -2773,7 +2773,7 @@ handle_request(int desc)
|
|||
*(unsigned long*)wi->buf = port;
|
||||
}
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
/* closesocket(sock); */
|
||||
#else
|
||||
close(sock);
|
||||
|
@ -2858,7 +2858,7 @@ handle_request(int desc)
|
|||
memset(&sa, '\0', sizeof(sa));
|
||||
sa.sin_family = AF_INET;
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
/* COMMENT: (3 Nov 2004 by Wim Oudshoorn):
|
||||
The comment below might be true. But
|
||||
using addr[0].s_addr has on windows 2003 server
|
||||
|
@ -2878,7 +2878,7 @@ handle_request(int desc)
|
|||
sa.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
#else
|
||||
sa.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
sa.sin_port = htons(p);
|
||||
result = bind(sock, (void*)&sa, sizeof(sa));
|
||||
if (result == 0)
|
||||
|
@ -2887,7 +2887,7 @@ handle_request(int desc)
|
|||
m = 0;
|
||||
}
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
closesocket(sock);
|
||||
#else
|
||||
close(sock);
|
||||
|
@ -3033,7 +3033,7 @@ handle_request(int desc)
|
|||
snprintf(ebuf, sizeof(ebuf), "Probe from '%s'", inet_ntoa(sin));
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (IN_CLASSA(sin.s_addr))
|
||||
{
|
||||
net = sin.s_addr & IN_CLASSA_NET;
|
||||
|
@ -3172,7 +3172,7 @@ handle_request(int desc)
|
|||
"Probe reply from '%s'", inet_ntoa(sin));
|
||||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (IN_CLASSA(sin.s_addr))
|
||||
{
|
||||
net = sin.s_addr & IN_CLASSA_NET;
|
||||
|
@ -3275,7 +3275,7 @@ handle_send()
|
|||
*/
|
||||
if (entry->pos != entry->len)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EWOULDBLOCK)
|
||||
|
@ -3340,7 +3340,7 @@ handle_write(int desc)
|
|||
ptr = wi->buf;
|
||||
len = wi->len;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
r = send(desc, &ptr[wi->pos], len - wi->pos, 0);
|
||||
#else
|
||||
r = write(desc, &ptr[wi->pos], len - wi->pos);
|
||||
|
@ -3451,14 +3451,14 @@ tryRead(int desc, int tim, unsigned char* dat, int len)
|
|||
}
|
||||
else if (len > 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
rval = recv(desc, (char *)&dat[pos], len - pos, 0);
|
||||
#else
|
||||
rval = read(desc, &dat[pos], len - pos);
|
||||
#endif
|
||||
if (rval < 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EWOULDBLOCK)
|
||||
|
@ -3557,7 +3557,7 @@ tryWrite(int desc, int tim, unsigned char* dat, int len)
|
|||
}
|
||||
else if (len > 0)
|
||||
{
|
||||
#ifdef __MINGW32__ /* FIXME: Is this correct? */
|
||||
#ifdef __MINGW__ /* FIXME: Is this correct? */
|
||||
rval = send(desc, (const char*)&dat[pos], len - pos, 0);
|
||||
#else
|
||||
void (*ifun)();
|
||||
|
@ -3573,7 +3573,7 @@ tryWrite(int desc, int tim, unsigned char* dat, int len)
|
|||
|
||||
if (rval <= 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EWOULDBLOCK)
|
||||
|
@ -3613,9 +3613,9 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
unsigned long port = *p;
|
||||
gdo_req msg;
|
||||
struct sockaddr_in sin;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
unsigned long dummy;
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
*p = 0;
|
||||
if (desc < 0)
|
||||
|
@ -3623,7 +3623,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
return 1; /* Couldn't create socket. */
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
dummy = 1;
|
||||
if (ioctlsocket(desc, FIONBIO, &dummy) < 0)
|
||||
{
|
||||
|
@ -3632,7 +3632,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
WSASetLastError(e);
|
||||
return 2; /* Couldn't set non-blocking. */
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
#else /* !__MINGW__ */
|
||||
if ((e = fcntl(desc, F_GETFL, 0)) >= 0)
|
||||
{
|
||||
e |= NBLK_OPT;
|
||||
|
@ -3651,12 +3651,12 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
errno = e;
|
||||
return 2; /* Couldn't set non-blocking. */
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
memcpy(&sin, addr, sizeof(sin));
|
||||
if (connect(desc, (struct sockaddr*)&sin, sizeof(sin)) != 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
if (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno == EINPROGRESS)
|
||||
|
@ -3666,7 +3666,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
if (e == -2)
|
||||
{
|
||||
e = errno;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -3677,7 +3677,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
else if (e == -1)
|
||||
{
|
||||
e = errno;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -3689,7 +3689,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
else
|
||||
{
|
||||
e = errno;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -3713,7 +3713,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
e = tryWrite(desc, 10, (uptr)&msg, GDO_REQ_SIZE);
|
||||
if (e != GDO_REQ_SIZE)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3727,7 +3727,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
e = tryRead(desc, 3, (uptr)&port, 4);
|
||||
if (e != 4)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3752,7 +3752,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
if (tryRead(desc, 3, b, len) != len)
|
||||
{
|
||||
free(b);
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3778,7 +3778,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
if (tryRead(desc, 3, b, len) != len)
|
||||
{
|
||||
free(b);
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
e = WSAGetLastError();
|
||||
closesocket(desc);
|
||||
WSASetLastError(e);
|
||||
|
@ -3810,7 +3810,7 @@ int ptype, struct sockaddr_in* addr, unsigned short* p, uptr*v)
|
|||
}
|
||||
|
||||
*p = (unsigned short)port;
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
closesocket(desc);
|
||||
#else
|
||||
close(desc);
|
||||
|
@ -4275,7 +4275,7 @@ static void do_help(int argc, char **argv, char *options)
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
static char*
|
||||
quoteArg(const char *arg)
|
||||
{
|
||||
|
@ -4387,7 +4387,7 @@ main(int argc, char** argv)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
|
||||
|
@ -4399,7 +4399,7 @@ main(int argc, char** argv)
|
|||
* Would use inet_aton(), but older systems don't have it.
|
||||
*/
|
||||
loopback.s_addr = inet_addr("127.0.0.1");
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
class_a_net = IN_CLASSA_NET;
|
||||
class_a_mask.s_addr = class_a_net;
|
||||
class_b_net = IN_CLASSB_NET;
|
||||
|
@ -4680,7 +4680,7 @@ printf(
|
|||
exit (0);
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__ /* On Win32, we don't fork */
|
||||
#ifdef __MINGW__ /* On Win32, we don't fork */
|
||||
if (nofork == 0)
|
||||
{
|
||||
char **a = malloc((argc+2) * sizeof(char*));
|
||||
|
@ -4778,7 +4778,7 @@ printf(
|
|||
gdomap_log(LOG_DEBUG);
|
||||
}
|
||||
|
||||
#endif /* !__MINGW32__ */
|
||||
#endif /* !__MINGW__ */
|
||||
|
||||
init_my_port(); /* Determine port to listen on. */
|
||||
init_ports(); /* Create ports to handle requests. */
|
||||
|
@ -4825,7 +4825,7 @@ printf(
|
|||
{
|
||||
FILE *fptr;
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
if (getuid () == 0)
|
||||
#endif
|
||||
{
|
||||
|
@ -4843,7 +4843,7 @@ printf(
|
|||
fclose(fptr);
|
||||
chmod(pidfile, 0644);
|
||||
}
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
else
|
||||
{
|
||||
snprintf(ebuf, sizeof(ebuf),
|
||||
|
@ -4853,7 +4853,7 @@ printf(
|
|||
#endif
|
||||
}
|
||||
{
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
int uid = -2;
|
||||
int gid = -2;
|
||||
#endif
|
||||
|
@ -4874,7 +4874,7 @@ printf(
|
|||
/*
|
||||
* As another level of paranoia - restrict this process to /tmp
|
||||
*/
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
if (chdir("/tmp") < 0)
|
||||
{
|
||||
snprintf(ebuf, sizeof(ebuf), "Unable to change directory to /tmp");
|
||||
|
@ -4892,10 +4892,10 @@ printf(
|
|||
}
|
||||
chdir("/");
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
#endif /* __svr4__ */
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#ifndef __MINGW__
|
||||
/*
|
||||
* Try to become a 'safe' user now that we have
|
||||
* done everything that needs root priv.
|
||||
|
@ -4929,7 +4929,7 @@ printf(
|
|||
gdomap_log(LOG_CRIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
}
|
||||
|
||||
init_probe(); /* Probe other name servers on net. */
|
||||
|
|
|
@ -76,7 +76,7 @@ main(int argc, char** argv, char **env)
|
|||
NSString *name = [[args objectAtIndex: 1] lowercaseString];
|
||||
NSString *sep;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#ifdef __MINGW__
|
||||
sep = @";";
|
||||
#else
|
||||
sep = @":";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW__)
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
|
@ -16,7 +16,7 @@
|
|||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <signal.h>
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue