mirror of https://github.com/axmolengine/axmol.git
modify mac out file
This commit is contained in:
parent
90bd722bd2
commit
cee5754db4
|
@ -1243,6 +1243,7 @@
|
|||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CONFIGURATION_BUILD_DIR = ../../../runtime/mac;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = mac/Prefix.pch;
|
||||
|
|
|
@ -21,8 +21,12 @@ string getIPAddress()
|
|||
if (cursor->ifa_addr->sa_family == AF_INET && (cursor->ifa_flags & IFF_LOOPBACK) == 0)
|
||||
{
|
||||
NSString *name = [NSString stringWithUTF8String:cursor->ifa_name];
|
||||
if ([name isEqualToString:@"en0"]) // Wi-Fi adapter
|
||||
return [[NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)cursor->ifa_addr)->sin_addr)]UTF8String];
|
||||
if ([name rangeOfString:@"en" options:NSCaseInsensitiveSearch].length > 0) {
|
||||
string ipaddr = [[NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)cursor->ifa_addr)->sin_addr)]UTF8String];
|
||||
if (!ipaddr.empty()) {
|
||||
return ipaddr;
|
||||
}
|
||||
}
|
||||
}
|
||||
cursor = cursor->ifa_next;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue