David, Thank for the detail. i have reported the bug(#27801515) for XCODE version number values.
As you suggested, i have resolved the compilation issue by using __IPHONE_OS_VERSION_MAX_ALLOWED macro. Thanks Sasikumar JP On 11 August 2016 at 16:33, David Duncan <david.dun...@apple.com> wrote: > > > On Aug 11, 2016, at 12:09 AM, Sasikumar JP <jps...@gmail.com> wrote: > > > > Hi, > > Xcode defines following build variables, we can not use them in Xcode 8 > > as the values are invalid octal number. > > > > XCODE_VERSION_ACTUAL = 0800 > > XCODE_VERSION_MAJOR = 0800 > > XCODE_VERSION_MINOR = 0800 > > Sounds like you should write up a bug for this, but I’m not really aware > of what the use case for comparing the Xcode version would be to be > honest... > > > > > > > I am working on iOS project, it should be compilable in both Xcode 7 and > Xcode 8. > > I am planning to add the conditional compilation like below > > > > preprocessor macro: > > > > XCODE_VERS=$(XCODE_VERSION_MAJOR) > > > > > > #if XCODE_VERS > 0700 > > > > @interface SampleTableCell : UITableViewCell<CAAnimationDelegate> > > > > #else > > > > @interface SampleTableCell : UITableViewCell > > > > #endif > > > > > > But this code throws the compilation error (Invalid digit '8' in octal > > constant) in Xcode 8, since 0800 is not a valid octal value. > > > > Is there any work around other than creating 2 different targets(separate > > target for Xcode 7 and Xcode 8) > > You don’t want the Xcode version here, you want the iOS SDK version, which > in this case is represented by the conditional > "__IPHONE_OS_VERSION_MAX_ALLOWED > >= __IPHONE_10_0” (MAX_ALLOWED corresponds to the SDK version you link > against, in this case the iOS 10.0 SDK). > > But in the long run building with Xcode 8 (and the iOS 10.0 or later SDK) > will be a given, so I suspect that most solve this problem by branching for > that SDK and all the updates that come with it rather than maintaining > conditionals like this in their code. > -- > David Duncan > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com