diff --git a/Source/GSLocale.m b/Source/GSLocale.m index e4eafc809..c2a669802 100644 --- a/Source/GSLocale.m +++ b/Source/GSLocale.m @@ -319,10 +319,12 @@ GSLanguagesFromLocale(NSString *locale) NSString *GSDefaultLanguageLocale() { - NSString *backup, *locale = nil; + NSString *locale = nil; #ifdef HAVE_LOCALE_H #ifdef LC_MESSAGES + NSString *backup; + [gnustep_global_lock lock]; backup = privateSetLocale(LC_ALL, nil); diff --git a/Source/GSNetwork.h b/Source/GSNetwork.h index 2c3abd4a0..2dbb5c302 100644 --- a/Source/GSNetwork.h +++ b/Source/GSNetwork.h @@ -40,6 +40,10 @@ #if defined(_WIN32) +#if defined(__WIN64__) +#include +#endif + #include #include #include diff --git a/Source/win32/GSFileHandle.m b/Source/win32/GSFileHandle.m index 0bd60869e..f643eda36 100644 --- a/Source/win32/GSFileHandle.m +++ b/Source/win32/GSFileHandle.m @@ -22,9 +22,14 @@ Boston, MA 02111 USA. */ -/* mingw wants winsock2.h before windows.h */ +#if defined(__WIN64__) +#include +#include +#else +/* mingw32 wants winsock2.h before windows.h */ #include #include +#endif #include "common.h" @@ -789,7 +794,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; NSLog(@"bad address-service-protocol combination"); return nil; } - [self setAddr: &sin]; // Store the address of the remote end. + // Store the address of the remote end. + [self setAddr: (struct sockaddr *)&sin]; /* * Don't use SOCKS if we are contacting the local host. @@ -963,7 +969,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; acceptOK = YES; readOK = NO; writeOK = NO; - [self setAddr: &sin]; + [self setAddr: (struct sockaddr *)&sin]; } return self; } @@ -1746,13 +1752,11 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; NSMutableDictionary *info = readInfo; NSNotification *n; NSNotificationCenter *q; - NSArray *modes; NSString *name; [self ignoreReadDescriptor]; readInfo = nil; readMax = 0; - modes = (NSArray*)[info objectForKey: NSFileHandleNotificationMonitorModes]; name = (NSString*)[info objectForKey: NotificationKey]; if (name == nil) @@ -1772,11 +1776,9 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; NSMutableDictionary *info = [writeInfo objectAtIndex: 0]; NSNotificationCenter *q; NSNotification *n; - NSArray *modes; NSString *name; [self ignoreWriteDescriptor]; - modes = (NSArray*)[info objectForKey: NSFileHandleNotificationMonitorModes]; name = (NSString*)[info objectForKey: NotificationKey]; n = [NSNotification notificationWithName: name object: self userInfo: info]; @@ -2055,7 +2057,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; closeOnDealloc: YES]; h->isSocket = YES; getpeername(desc, (struct sockaddr*)&sin, &size); - [h setAddr: &sin]; + [h setAddr: (struct sockaddr *)&sin]; [readInfo setObject: h forKey: NSFileHandleNotificationFileHandleItem]; RELEASE(h); @@ -2356,12 +2358,14 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; return nil; /* Don't restart timed out events */ } -- (void) setAddr: (struct sockaddr_in *)sin +- (void) setAddr: (struct sockaddr *)sin { + struct sockaddr_in *s = (struct sockaddr_in *)sin; + address = [[NSString alloc] initWithUTF8String: - (char*)inet_ntoa(sin->sin_addr)]; + (char*)inet_ntoa(s->sin_addr)]; service = [[NSString alloc] initWithFormat: @"%d", - (int)GSSwapBigI16ToHost(sin->sin_port)]; + (int)GSSwapBigI16ToHost(s->sin_port)]; protocol = @"tcp"; } diff --git a/Source/win32/NSMessagePortNameServer.m b/Source/win32/NSMessagePortNameServer.m index d19d43957..d0154e8c3 100644 --- a/Source/win32/NSMessagePortNameServer.m +++ b/Source/win32/NSMessagePortNameServer.m @@ -377,11 +377,10 @@ OutputDebugStringW(L""); - (BOOL) removePortForName: (NSString *)name { NSString *n; - int rc; NSDebugLLog(@"NSMessagePortNameServer", @"removePortForName: %@", name); n = [[self class] _translate: name]; - rc = RegDeleteValueW(key, UNISTR(n)); + (void)RegDeleteValueW(key, UNISTR(n)); return YES; }