Author: rfm
Date: Mon Jun 27 21:06:12 2016
New Revision: 39933

URL: http://svn.gna.org/viewcvs/gnustep?rev=39933&view=rev
Log:
msys 64bit tweaks

Modified:
    libs/base/trunk/Source/GSFastEnumeration.h
    libs/base/trunk/Source/GSSocketStream.m
    libs/base/trunk/Source/NSBundle.m
    libs/base/trunk/Source/NSException.m
    libs/base/trunk/Source/NSHost.m

Modified: libs/base/trunk/Source/GSFastEnumeration.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSFastEnumeration.h?rev=39933&r1=39932&r2=39933&view=diff
==============================================================================
--- libs/base/trunk/Source/GSFastEnumeration.h  (original)
+++ libs/base/trunk/Source/GSFastEnumeration.h  Mon Jun 27 21:06:12 2016
@@ -1,38 +1,39 @@
 
 #ifdef __clang__
 #define FOR_IN(type, var, collection) \
-       for (type var in collection)\
-       {
+  for (type var in collection)\
+  {
 #define END_FOR_IN(collection) }
 #else
 void objc_enumerationMutation(id);
 #define FOR_IN(type, var, c) \
 do\
 {\
-       type var;\
-       NSFastEnumerationState gs_##c##_enumState = { 0 };\
-       id gs_##c##_items[16];\
-       unsigned long gs_##c##_limit = \
-               [c countByEnumeratingWithState: &gs_##c##_enumState \
-                                      objects: gs_##c##_items \
-                                        count: 16];\
-       if (gs_##c##_limit)\
-       {\
-               unsigned long gs_startMutations = 
*gs_##c##_enumState.mutationsPtr;\
-               do {\
-                       unsigned long gs_##c##counter = 0;\
-                       do {\
-                               if (gs_startMutations != 
*gs_##c##_enumState.mutationsPtr)\
-                               {\
-                                       objc_enumerationMutation(c);\
-                               }\
-                               var = 
gs_##c##_enumState.itemsPtr[gs_##c##counter++];\
+  type var;\
+  NSFastEnumerationState gs_##c##_enumState = { 0 };\
+  id gs_##c##_items[16];\
+  unsigned long gs_##c##_limit = \
+    [c countByEnumeratingWithState: &gs_##c##_enumState \
+                           objects: gs_##c##_items \
+                             count: 16];\
+  if (gs_##c##_limit)\
+  {\
+    unsigned long gs_startMutations = *gs_##c##_enumState.mutationsPtr;\
+    do {\
+      unsigned long gs_##c##counter = 0;\
+      do {\
+        if (gs_startMutations != *gs_##c##_enumState.mutationsPtr)\
+        {\
+          objc_enumerationMutation(c);\
+        }\
+        var = gs_##c##_enumState.itemsPtr[gs_##c##counter++];\
 
 #define END_FOR_IN(c) \
-                       } while (gs_##c##counter < gs_##c##_limit);\
-               } while ((gs_##c##_limit = [c countByEnumeratingWithState: 
&gs_##c##_enumState\
-                                                                 objects: 
gs_##c##_items\
-                                                                   count: 
16]));\
-       }\
+      } while (gs_##c##counter < gs_##c##_limit);\
+    } while ((gs_##c##_limit \
+      = [c countByEnumeratingWithState: &gs_##c##_enumState\
+                              objects: gs_##c##_items\
+                                count: 16]));\
+  }\
 } while(0);
 #endif

Modified: libs/base/trunk/Source/GSSocketStream.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSSocketStream.m?rev=39933&r1=39932&r2=39933&view=diff
==============================================================================
--- libs/base/trunk/Source/GSSocketStream.m     (original)
+++ libs/base/trunk/Source/GSSocketStream.m     Mon Jun 27 21:06:12 2016
@@ -58,6 +58,9 @@
 #ifdef _WIN32
 extern const char *inet_ntop(int, const void *, char *, size_t);
 extern int inet_pton(int , const char *, void *);
+#define        OPTLEN  int
+#else
+#define        OPTLEN  socklen_t
 #endif
 
 unsigned
@@ -1492,14 +1495,14 @@
       memset(&sin, '\0', size);
       if ([key isEqualToString: GSStreamLocalAddressKey])
        {
-         if (getsockname(s, (struct sockaddr*)&sin, &size) != -1)
+         if (getsockname(s, (struct sockaddr*)&sin, (OPTLEN*)&size) != -1)
            {
              result = GSPrivateSockaddrHost(&sin);
            }
        }
       else if ([key isEqualToString: GSStreamLocalPortKey])
        {
-         if (getsockname(s, (struct sockaddr*)&sin, &size) != -1)
+         if (getsockname(s, (struct sockaddr*)&sin, (OPTLEN*)&size) != -1)
            {
              result = [NSString stringWithFormat: @"%d",
                (int)GSPrivateSockaddrPort(&sin)];
@@ -1507,14 +1510,14 @@
        }
       else if ([key isEqualToString: GSStreamRemoteAddressKey])
        {
-         if (getpeername(s, (struct sockaddr*)&sin, &size) != -1)
+         if (getpeername(s, (struct sockaddr*)&sin, (OPTLEN*)&size) != -1)
            {
              result = GSPrivateSockaddrHost(&sin);
            }
        }
       else if ([key isEqualToString: GSStreamRemotePortKey])
        {
-         if (getpeername(s, (struct sockaddr*)&sin, &size) != -1)
+         if (getpeername(s, (struct sockaddr*)&sin, (OPTLEN*)&size) != -1)
            {
              result = [NSString stringWithFormat: @"%d",
                (int)GSPrivateSockaddrPort(&sin)];
@@ -1997,7 +2000,7 @@
              socklen_t len = sizeof(error);
 
              getReturn = getsockopt(_sock, SOL_SOCKET, SO_ERROR,
-               (char*)&error, &len);
+               (char*)&error, (OPTLEN*)&len);
            }
 
          if (getReturn >= 0 && error == 0
@@ -2079,7 +2082,8 @@
 
       IF_NO_GC([[self retain] autorelease];)
       [self _unschedule];
-      result = getsockopt([self _sock], SOL_SOCKET, SO_ERROR, &error, &len);
+      result = getsockopt([self _sock], SOL_SOCKET, SO_ERROR,
+       &error, (OPTLEN*)&len);
 
       if (result >= 0 && !error)
         { // finish up the opening
@@ -2434,7 +2438,7 @@
              socklen_t len = sizeof(error);
 
              getReturn = getsockopt(_sock, SOL_SOCKET, SO_ERROR,
-               (char*)&error, &len);
+               (char*)&error, (OPTLEN*)&len);
            }
 
          if (getReturn >= 0 && error == 0
@@ -2514,8 +2518,8 @@
 
       IF_NO_GC([[self retain] autorelease];)
       [self _schedule];
-      result
-       = getsockopt((intptr_t)_loopID, SOL_SOCKET, SO_ERROR, &error, &len);
+      result = getsockopt((intptr_t)_loopID, SOL_SOCKET, SO_ERROR,
+       &error, (OPTLEN*)&len);
       if (result >= 0 && !error)
         { // finish up the opening
           myEvent = NSStreamEventOpenCompleted;
@@ -2634,7 +2638,7 @@
       int      status = 1;
 
       setsockopt([self _sock], SOL_SOCKET, SO_REUSEADDR,
-        (char *)&status, sizeof(status));
+        (char *)&status, (OPTLEN)sizeof(status));
     }
 #endif
 
@@ -2702,7 +2706,7 @@
   socklen_t            len = sizeof(buf);
   int                  acceptReturn;
 
-  acceptReturn = accept([self _sock], addr, &len);
+  acceptReturn = accept([self _sock], addr, (OPTLEN*)&len);
   _events &= ~NSStreamEventHasBytesAvailable;
   if (socketError(acceptReturn))
     { // test for real error

Modified: libs/base/trunk/Source/NSBundle.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSBundle.m?rev=39933&r1=39932&r2=39933&view=diff
==============================================================================
--- libs/base/trunk/Source/NSBundle.m   (original)
+++ libs/base/trunk/Source/NSBundle.m   Mon Jun 27 21:06:12 2016
@@ -51,6 +51,7 @@
 #import "Foundation/NSData.h"
 #import "Foundation/NSURL.h"
 #import "Foundation/NSValue.h"
+#import "Foundation/NSSet.h"
 #import "GNUstepBase/NSString+GNUstepBase.h"
 #import "GNUstepBase/NSTask+GNUstepBase.h"
 

Modified: libs/base/trunk/Source/NSException.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSException.m?rev=39933&r1=39932&r2=39933&view=diff
==============================================================================
--- libs/base/trunk/Source/NSException.m        (original)
+++ libs/base/trunk/Source/NSException.m        Mon Jun 27 21:06:12 2016
@@ -656,7 +656,7 @@
          if (0 == hModule)
            {
              fprintf(stderr, "Failed to load kernel32.dll with error: %d\n",
-               GetLastError());
+               (int)GetLastError());
              [traceLock unlock];
              return self;
            }
@@ -665,7 +665,7 @@
          if (0 == capture)
            {
              fprintf(stderr, "Failed to find RtlCaptureStackBackTrace: %d\n",
-               GetLastError());
+               (int)GetLastError());
              [traceLock unlock];
              return self;
            }
@@ -673,7 +673,7 @@
          if (0 == hModule)
            {
              fprintf(stderr, "Failed to load dbghelp.dll with error: %d\n",
-               GetLastError());
+               (int)GetLastError());
              [traceLock unlock];
              return self;
            }
@@ -682,7 +682,7 @@
          if (0 == optSym)
            {
              fprintf(stderr, "Failed to find SymSetOptions: %d\n",
-               GetLastError());
+               (int)GetLastError());
              [traceLock unlock];
              return self;
            }
@@ -691,7 +691,7 @@
          if (0 == initSym)
            {
              fprintf(stderr, "Failed to find SymInitialize: %d\n",
-               GetLastError());
+               (int)GetLastError());
              [traceLock unlock];
              return self;
            }
@@ -700,7 +700,7 @@
          if (0 == fromSym)
            {
              fprintf(stderr, "Failed to find SymFromAddr: %d\n",
-               GetLastError());
+               (int)GetLastError());
              [traceLock unlock];
              return self;
            }
@@ -711,7 +711,7 @@
       if (!(initSym)(hProcess, NULL, TRUE))
        {
          fprintf(stderr, "SymInitialize failed with error: %d\n",
-           GetLastError());
+           (int)GetLastError());
          fromSym = 0;
          [traceLock unlock];
          return self;

Modified: libs/base/trunk/Source/NSHost.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSHost.m?rev=39933&r1=39932&r2=39933&view=diff
==============================================================================
--- libs/base/trunk/Source/NSHost.m     (original)
+++ libs/base/trunk/Source/NSHost.m     Mon Jun 27 21:06:12 2016
@@ -41,6 +41,8 @@
 #if defined(_WIN32)
 #include <winsock2.h>
 #include <ws2tcpip.h>
+extern const char *inet_ntop(int, const void *, char *, size_t);
+extern int inet_pton(int , const char *, void *);
 #else
 #include <netdb.h>
 #include <sys/param.h>


_______________________________________________
Gnustep-cvs mailing list
Gnustep-cvs@gna.org
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to