Applied mingw fixes by Mateu Batle

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19242 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2004-05-06 12:10:03 +00:00
parent 46e30f1fd0
commit 0407dc9e41
5 changed files with 17 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2004-05-06 Mateu Batle
* Tools/gdomap.c: mingw fixes.
* Headers/Foundation/NSPort.h: ditto
* Source/NSSocketPort.m: ditto
2004-05-03 22:12 Alexander Malmberg <alexander@malmberg.org> 2004-05-03 22:12 Alexander Malmberg <alexander@malmberg.org>
* Source/NSString.m (-hash), * Source/NSString.m (-hash),

View file

@ -124,7 +124,7 @@ typedef SOCKET NSSocketNativeHandle;
- (void) addHandle: (GSTcpHandle*)handle forSend: (BOOL)send; - (void) addHandle: (GSTcpHandle*)handle forSend: (BOOL)send;
- (NSString*) address; - (NSString*) address;
- (void) getFds: (SOCKET*)fds count: (int*)count; - (void) getFds: (int*)fds count: (int*)count;
- (GSTcpHandle*) handleForPort: (NSSocketPort*)recvPort - (GSTcpHandle*) handleForPort: (NSSocketPort*)recvPort
beforeDate: (NSDate*)when; beforeDate: (NSDate*)when;
- (void) handlePortMessage: (NSPortMessage*)m; - (void) handlePortMessage: (NSPortMessage*)m;

View file

@ -611,7 +611,7 @@ static Class runLoopClass;
desc, inet_ntoa(sockAddr.sin_addr), ntohs(sockAddr.sin_port)]; desc, inet_ntoa(sockAddr.sin_addr), ntohs(sockAddr.sin_port)];
} }
- (SOCKET) descriptor - (int) descriptor
{ {
return desc; return desc;
} }
@ -1583,7 +1583,7 @@ static unsigned wordAlign;
* This is a callback method used by the NSRunLoop class to determine which * This is a callback method used by the NSRunLoop class to determine which
* descriptors to watch for the port. * descriptors to watch for the port.
*/ */
- (void) getFds: (SOCKET*)fds count: (int*)count - (void) getFds: (int*)fds count: (int*)count
{ {
NSMapEnumerator me; NSMapEnumerator me;
SOCKET sock; SOCKET sock;
@ -1894,7 +1894,7 @@ static unsigned wordAlign;
handle->recvPort = nil; handle->recvPort = nil;
} }
NSMapRemove(handles, (void*)(gsaddr)[handle descriptor]); NSMapRemove(handles, (void*)(gsaddr)[handle descriptor]);
if (listener < 0 && NSCountMapTable(handles) == 0) if (((int) listener) < 0 && NSCountMapTable(handles) == 0)
{ {
[self invalidate]; [self invalidate];
} }

View file

@ -851,6 +851,9 @@ NSTemporaryDirectory(void)
perm = [[attr objectForKey: NSFilePosixPermissions] intValue]; perm = [[attr objectForKey: NSFilePosixPermissions] intValue];
perm = perm & 0777; perm = perm & 0777;
// Mateu Batle: secure temporary directories don't work in MinGW
#ifndef __MINGW__
#if defined(__MINGW__) #if defined(__MINGW__)
uid = owner; uid = owner;
#else #else
@ -900,6 +903,7 @@ NSTemporaryDirectory(void)
return nil; /* Not reached. */ return nil; /* Not reached. */
} }
} }
#endif
if ([manager isWritableFileAtPath: tempDirName] == NO) if ([manager isWritableFileAtPath: tempDirName] == NO)
{ {

View file

@ -1082,7 +1082,7 @@ init_iface()
if (desc == INVALID_SOCKET) if (desc == INVALID_SOCKET)
{ {
sprintf(ebuf, "Failed to get a socket. Error %s\n", WSAGetLastError()); sprintf(ebuf, "Failed to get a socket. Error %d\n", WSAGetLastError());
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -1091,7 +1091,7 @@ init_iface()
if (WSAIoctl(desc, SIO_GET_INTERFACE_LIST, 0, 0, (void*)InterfaceList, if (WSAIoctl(desc, SIO_GET_INTERFACE_LIST, 0, 0, (void*)InterfaceList,
sizeof(InterfaceList), &nBytesReturned, 0, 0) == SOCKET_ERROR) sizeof(InterfaceList), &nBytesReturned, 0, 0) == SOCKET_ERROR)
{ {
sprintf(ebuf, "Failed WSAIoctl. Error %s\n", WSAGetLastError()); sprintf(ebuf, "Failed WSAIoctl. Error %d\n", WSAGetLastError());
gdomap_log(LOG_CRIT); gdomap_log(LOG_CRIT);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -1159,7 +1159,7 @@ init_iface()
if (addr[interfaces].s_addr == 0) if (addr[interfaces].s_addr == 0)
{ {
addr[interfaces].s_addr = htonl(0x8f000001); addr[interfaces].s_addr = htonl(0x8f000001);
fprintf(stderr, "Bad iface addr (0.0.0.0) guess (127.0.0.1)\n", fprintf(stderr, "Bad iface addr (0.0.0.0) guess (%s)\n",
inet_ntoa(addr[interfaces])); inet_ntoa(addr[interfaces]));
} }
if (mask[interfaces].s_addr == 0) if (mask[interfaces].s_addr == 0)