• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.


  • Subject: Re: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 11 Dec 2007 10:59:40 +0000

On 11 Dec 2007, at 00:24, Ryan Poling wrote:

I've been running into some issues developing a project on Leopard (10.5.1) which I want to run on any version of Tiger (10.4.x) in addition to Leopard. In Xcode, I've set my "Cross-Develop Using Target SDK:" to "Mac OS X 10.5" and set my "Mac OS X Deployment Target" to "Mac OS X 10.4." This should, theoretically, allow me to use features present only in Leopard if I'm running on Leopard (like the new animator), but also still run normally on Tiger.

Although this mostly seems to be working, I keep running into cases where I've accidentally called some bit of Apple code which isn't present until Leopard (NSURLRequestReloadIgnoringLocalCacheData was the last one).

I filed a bug report over two years ago now <rdar://4159295> asking for a mechanism to cause the compiler to warn about use of APIs newer than a specified version unless I took action to prevent it.


The example I gave was something like

  if (<test for presence of API somehow>) {
    #pragma enable-api MACOSX_VERSION_10_5
    /* Use the 10.5 API here */
    #pragma enable-api
  } else {
    /* 10.4-compatible code here */
  }

but obviously there are lots of choices that could be made about the syntax.

I don't *think* this issue has been addressed; certainly my bug report is still open. And in the absence of such a feature, your options are:

  1. Build against the Tiger SDK and don't use Leopard features at all.

2. Put Leopard code in its own files, and use different settings for just those files.

  3. Do what you are doing now, plus *lots* of testing.

My experience of developing simultaneously for 10.4 and 10.3, and before that for 10.3 and 10.2, leads me to conclude that this problem is something of a nuisance in practice, which is why I filed a bug report.

(If you file a bug report on this as well, please refer to mine as it will make it easier for the people at Apple to see that there's more than one request for this type of feature.)

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

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


  • Follow-Ups:
    • Re: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.
      • From: Ryan Poling <email@hidden>
References: 
 >Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5. (From: Ryan Poling <email@hidden>)

  • Prev by Date: Re: Adaptable NSTableViewHeader
  • Next by Date: Re: Notification for Idle Time?
  • Previous by thread: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.
  • Next by thread: Re: Making sure my code will run on Tiger 10.4 when I'm compiling on Leopard 10.5.
  • Index(es):
    • Date
    • Thread