mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-03 10:00:51 +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>
|
2010-04-22 David Wetzel <dave@turbocat.de>
|
||||||
|
|
||||||
* Source/Additions/Unicode.m: replace objc_malloc with NSZoneMalloc
|
* Source/Additions/Unicode.m: replace objc_malloc with NSZoneMalloc
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
|
#if defined(NeXT_Foundation_LIBRARY)
|
||||||
|
|
||||||
#import "Foundation/NSByteOrder.h"
|
#import "Foundation/NSByteOrder.h"
|
||||||
#import "Foundation/NSHost.h"
|
#import "Foundation/NSHost.h"
|
||||||
#import "GSNetwork.h"
|
#import "GSNetwork.h"
|
||||||
|
@ -44,7 +47,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct addrinfo **ai, stru
|
||||||
const char *cPortn = NULL;
|
const char *cPortn = NULL;
|
||||||
int e = 0;
|
int e = 0;
|
||||||
|
|
||||||
if (!svc) {
|
if (!svc)
|
||||||
|
{
|
||||||
NSLog(@"service is nil.");
|
NSLog(@"service is nil.");
|
||||||
|
|
||||||
return NO;
|
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_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
||||||
hints->ai_protocol = IPPROTO_IP; // accept any
|
hints->ai_protocol = IPPROTO_IP; // accept any
|
||||||
|
|
||||||
if (pcl) {
|
if (pcl)
|
||||||
if ([pcl isEqualToString:@"tcp"]) {
|
{
|
||||||
|
if ([pcl isEqualToString:@"tcp"])
|
||||||
|
{
|
||||||
hints->ai_protocol = IPPROTO_TCP;
|
hints->ai_protocol = IPPROTO_TCP;
|
||||||
hints->ai_socktype = SOCK_STREAM;
|
hints->ai_socktype = SOCK_STREAM;
|
||||||
} else if ([pcl isEqualToString:@"udp"]) {
|
}
|
||||||
|
else if ([pcl isEqualToString:@"udp"])
|
||||||
|
{
|
||||||
hints->ai_protocol = IPPROTO_UDP;
|
hints->ai_protocol = IPPROTO_UDP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +95,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct addrinfo **ai, stru
|
||||||
//&ai
|
//&ai
|
||||||
e = getaddrinfo (cHostn, cPortn, hints, ai);
|
e = getaddrinfo (cHostn, cPortn, hints, ai);
|
||||||
|
|
||||||
if (e != 0) {
|
if (e != 0)
|
||||||
|
{
|
||||||
NSLog(@"getaddrinfo: %s", gai_strerror (e));
|
NSLog(@"getaddrinfo: %s", gai_strerror (e));
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@ -197,18 +206,18 @@ cleanup:
|
||||||
|
|
||||||
sadr = (struct sockaddr *) &sstore;
|
sadr = (struct sockaddr *) &sstore;
|
||||||
|
|
||||||
switch (sadr->sa_family) {
|
switch (sadr->sa_family)
|
||||||
|
{
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
{
|
{
|
||||||
|
|
||||||
char straddr[INET6_ADDRSTRLEN];
|
char straddr[INET6_ADDRSTRLEN];
|
||||||
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&sstore;
|
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&sstore;
|
||||||
|
|
||||||
inet_ntop(AF_INET6, &(addr6->sin6_addr), straddr,
|
inet_ntop(AF_INET6, &(addr6->sin6_addr), straddr,
|
||||||
sizeof(straddr));
|
sizeof(straddr));
|
||||||
|
|
||||||
return [NSString stringWithCString:straddr
|
return [NSString stringWithCString: straddr
|
||||||
encoding:NSASCIIStringEncoding];
|
encoding: NSASCIIStringEncoding];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
|
@ -218,8 +227,8 @@ cleanup:
|
||||||
|
|
||||||
char *address = inet_ntoa(addr4->sin_addr);
|
char *address = inet_ntoa(addr4->sin_addr);
|
||||||
|
|
||||||
return [NSString stringWithCString:address
|
return [NSString stringWithCString: address
|
||||||
encoding:NSASCIIStringEncoding];
|
encoding: NSASCIIStringEncoding];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -231,4 +240,5 @@ cleanup:
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#endif /* defined(NeXT_Foundation_LIBRARY) */
|
||||||
|
|
||||||
|
|
|
@ -1238,7 +1238,7 @@ quotedFromString(NSString *aString)
|
||||||
SetHandleInformation(hOut, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
SetHandleInformation(hOut, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
||||||
SetHandleInformation(hErr, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
SetHandleInformation(hErr, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
||||||
|
|
||||||
result = CreateProcessW(wexecutable,
|
result = CreateProcessW(NULL, //wexecutable,
|
||||||
w_args,
|
w_args,
|
||||||
NULL, /* proc attrs */
|
NULL, /* proc attrs */
|
||||||
NULL, /* thread attrs */
|
NULL, /* thread attrs */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue