Re: SCNetworkReachability and impact of Snow Leopard
Re: SCNetworkReachability and impact of Snow Leopard
- Subject: Re: SCNetworkReachability and impact of Snow Leopard
- From: Kevin Elliott <email@hidden>
- Date: Tue, 01 Sep 2009 14:37:05 -0700
On Aug 30, 2009, at 5:11 AM, Stuart Malin wrote:
I am writing some code on 10.5 Leopard that uses
SCNetworkReachability. The latest documentation (SysConfig.pdf dated
2009-07-30) shows the Network Reachability Flags (with names such as
kSCNetworkReachabilityFlagsReachable) as being declared in
SCNetworkReachability.h as of 10.6.
However, on 10.5, the flags (appear to me) to be defined in
SCNetwork.h, and have names like kSCNetworkFlagsReachable.
Question: What is the best way for me to write code now that will be
compliant with 10.6 Snow Leopard? Should I conditionally compile
and test against different flags? Or just keep using the SCNetwork.h
enum values until and unless I need one of the newly-defined-in-10.6
values?
The new names were introduced for iPhoneOS and then moved back to OS
X. On the iPhone, all of SystemConfiguration except Reachability is
private, so the new names make a bit more sense. If you look at the
actual values those enums define, you'll see that the values are
identical to maintain binary compatibility between Leopard and
SnowLeopard. The up shot is it doesn't matter which values you use,
as they compile down to identical code. I'd stick with the old values
to simplify building for/on Leopard.
-Kevin Elliott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden