mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
fix OSX specific file to not build elsewhere
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30223 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
97bc275de1
commit
80eecd3f50
3 changed files with 72 additions and 58 deletions
|
@ -1,3 +1,7 @@
|
|||
2010-04-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/NSFileHandle+GNUstepBase.m: fix to only build on OSX
|
||||
|
||||
2010-04-22 David Wetzel <dave@turbocat.de>
|
||||
|
||||
* Source/Additions/Unicode.m: replace objc_malloc with NSZoneMalloc
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
*/
|
||||
#import "common.h"
|
||||
|
||||
#if defined(NeXT_Foundation_LIBRARY)
|
||||
|
||||
#import "Foundation/NSByteOrder.h"
|
||||
#import "Foundation/NSHost.h"
|
||||
#import "GSNetwork.h"
|
||||
|
@ -44,7 +47,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct addrinfo **ai, stru
|
|||
const char *cPortn = NULL;
|
||||
int e = 0;
|
||||
|
||||
if (!svc) {
|
||||
if (!svc)
|
||||
{
|
||||
NSLog(@"service is nil.");
|
||||
|
||||
return NO;
|
||||
|
@ -53,11 +57,15 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct addrinfo **ai, stru
|
|||
hints->ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
||||
hints->ai_protocol = IPPROTO_IP; // accept any
|
||||
|
||||
if (pcl) {
|
||||
if ([pcl isEqualToString:@"tcp"]) {
|
||||
if (pcl)
|
||||
{
|
||||
if ([pcl isEqualToString:@"tcp"])
|
||||
{
|
||||
hints->ai_protocol = IPPROTO_TCP;
|
||||
hints->ai_socktype = SOCK_STREAM;
|
||||
} else if ([pcl isEqualToString:@"udp"]) {
|
||||
}
|
||||
else if ([pcl isEqualToString:@"udp"])
|
||||
{
|
||||
hints->ai_protocol = IPPROTO_UDP;
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +95,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct addrinfo **ai, stru
|
|||
//&ai
|
||||
e = getaddrinfo (cHostn, cPortn, hints, ai);
|
||||
|
||||
if (e != 0) {
|
||||
if (e != 0)
|
||||
{
|
||||
NSLog(@"getaddrinfo: %s", gai_strerror (e));
|
||||
return NO;
|
||||
}
|
||||
|
@ -197,18 +206,18 @@ cleanup:
|
|||
|
||||
sadr = (struct sockaddr *) &sstore;
|
||||
|
||||
switch (sadr->sa_family) {
|
||||
switch (sadr->sa_family)
|
||||
{
|
||||
case AF_INET6:
|
||||
{
|
||||
|
||||
char straddr[INET6_ADDRSTRLEN];
|
||||
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&sstore;
|
||||
|
||||
inet_ntop(AF_INET6, &(addr6->sin6_addr), straddr,
|
||||
sizeof(straddr));
|
||||
|
||||
return [NSString stringWithCString:straddr
|
||||
encoding:NSASCIIStringEncoding];
|
||||
return [NSString stringWithCString: straddr
|
||||
encoding: NSASCIIStringEncoding];
|
||||
break;
|
||||
}
|
||||
case AF_INET:
|
||||
|
@ -218,8 +227,8 @@ cleanup:
|
|||
|
||||
char *address = inet_ntoa(addr4->sin_addr);
|
||||
|
||||
return [NSString stringWithCString:address
|
||||
encoding:NSASCIIStringEncoding];
|
||||
return [NSString stringWithCString: address
|
||||
encoding: NSASCIIStringEncoding];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -231,4 +240,5 @@ cleanup:
|
|||
|
||||
@end
|
||||
|
||||
#endif /* defined(NeXT_Foundation_LIBRARY) */
|
||||
|
||||
|
|
|
@ -1238,7 +1238,7 @@ quotedFromString(NSString *aString)
|
|||
SetHandleInformation(hOut, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
||||
SetHandleInformation(hErr, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
||||
|
||||
result = CreateProcessW(wexecutable,
|
||||
result = CreateProcessW(NULL, //wexecutable,
|
||||
w_args,
|
||||
NULL, /* proc attrs */
|
||||
NULL, /* thread attrs */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue