Files
textmate/Frameworks/network/src/network.cc
Allan Odgaard 0e96a04d76 Remove compatibility checks
Since we now require 10.7 we don’t need all of this. Keeping it around is just noise that can lead to confusion about code paths.
2012-08-29 16:02:29 +02:00

21 lines
432 B
C++

#include "network.h"
namespace network
{
bool can_reach_host (char const* host)
{
bool res = false;
if(SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, host))
{
SCNetworkReachabilityFlags flags;
if(SCNetworkReachabilityGetFlags(ref, &flags))
{
if(flags & kSCNetworkReachabilityFlagsReachable)
res = true;
}
CFRelease(ref);
}
return res;
}
} /* network */