discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep On Windows (new patch)


From: Mateu Batle
Subject: Re: GNUstep On Windows (new patch)
Date: Thu, 06 May 2004 11:46:16 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113


Marc Ordinas i Llopis wrote:

S.J.Chun wrote:

README.MinGW says OpenSSL's address (I actually did make dll again using static archive) All other libraries are built using MinGW. (The patches are from GNUWin32 project, gnuwin32.sourceforge.net)

If you tried GUI/Back, did you also encountered gdnc related problem?

Yes, we do have the same problem.

Marc Ordinas i Llopis


Problem in gdnc is fixed, the problem was really in NSSocketPort.m,
the SOCKET type in Windows is unsigned and there was some code
assuming it was signed that never was executed. Because of this,
the port and connection were never invalidated, therefore
die and invalid notifications were never post.

I have put a patch in Savannah and attached to this email,
which includes other minor things too.

cheers !
 Mateu Batle
Index: Source/NSUser.m
===================================================================
--- Source/NSUser.m     (revision 87)
+++ Source/NSUser.m     (working copy)
@@ -870,6 +870,9 @@
   perm = [[attr objectForKey: NSFilePosixPermissions] intValue];
   perm = perm & 0777;
 
+// Mateu Batle: secure temporary directories don't work in MinGW
+#ifndef __MINGW__
+
 #if    defined(__MINGW__)
   uid = owner;
 #else
@@ -919,6 +922,7 @@
          return nil; /* Not reached. */
        }
     }
+#endif
 
   if ([manager isWritableFileAtPath: tempDirName] == NO)
     {
Index: Source/NSSocketPort.m
===================================================================
--- Source/NSSocketPort.m       (revision 87)
+++ Source/NSSocketPort.m       (working copy)
@@ -611,7 +611,7 @@
     desc, inet_ntoa(sockAddr.sin_addr), ntohs(sockAddr.sin_port)];
 }
 
-- (SOCKET) descriptor
+- (int) descriptor
 {
   return desc;
 }
@@ -1583,7 +1583,7 @@
  * This is a callback method used by the NSRunLoop class to determine which
  * descriptors to watch for the port.
  */
-- (void) getFds: (SOCKET*)fds count: (int*)count
+- (void) getFds: (int*)fds count: (int*)count
 {
   NSMapEnumerator      me;
   SOCKET               sock;
@@ -1894,7 +1894,7 @@
       handle->recvPort = nil;
     }
   NSMapRemove(handles, (void*)(gsaddr)[handle descriptor]);
-  if (listener < 0 && NSCountMapTable(handles) == 0)
+  if (((int) listener) < 0 && NSCountMapTable(handles) == 0)
     {
       [self invalidate];
     }
Index: Headers/Foundation/NSPort.h
===================================================================
--- Headers/Foundation/NSPort.h (revision 87)
+++ Headers/Foundation/NSPort.h (working copy)
@@ -124,7 +124,7 @@
 
 - (void) addHandle: (GSTcpHandle*)handle forSend: (BOOL)send;
 - (NSString*) address;
-- (void) getFds: (SOCKET*)fds count: (int*)count;
+- (void) getFds: (int*)fds count: (int*)count;
 - (GSTcpHandle*) handleForPort: (NSSocketPort*)recvPort
                    beforeDate: (NSDate*)when;
 - (void) handlePortMessage: (NSPortMessage*)m;
Index: Tools/gdomap.c
===================================================================
--- Tools/gdomap.c      (revision 87)
+++ Tools/gdomap.c      (working copy)
@@ -1082,7 +1082,7 @@
 
   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);
       exit(EXIT_FAILURE);
     }
@@ -1091,7 +1091,7 @@
   if (WSAIoctl(desc, SIO_GET_INTERFACE_LIST, 0, 0, (void*)InterfaceList,
     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);
       exit(EXIT_FAILURE);
     }
@@ -1159,7 +1159,7 @@
          if (addr[interfaces].s_addr == 0)
            {
              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]));
            }
          if (mask[interfaces].s_addr == 0)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]