title: How to determine if mac SDK is *less* than
body: <p>I have an application that target a minimum platform of 10.5, and it compiles fine with SDK 10.6 or 10.7.</p>
  
  <p>However, when compiling with an old version of xcode with 10.5 SDK, compilation fails and requires some extra #import (why it does I'm not sure, but it does). When I import the OpenGL header, I get an error about some types being unresolved. Adding <code>#import &lt;CarbonCore/Endian.h&gt;</code> fixes the problem (that's where the missing symbols are located).</p>
  
  <p>I do not want to perform the #import unless absolutely necessary, and in particular not do it when compiling with 10.6 or 10.7.</p>
  
  <p>I know how to check if I'm using a SDK that is superior to a given version, like so:</p>
  
  <pre><code>#if MAC_OS_X_VERSION_10_5 &gt; MACS_VERSION_MIN_REQUIRED
  // Mac &gt; 10.5 code here
  #endif
  </code></pre>
  
  <p>Problem is testing the reverse condition has proven to be non-trivial as all the later version of the SDK have all the defines found in earlier versions.</p>
  
  <p>I'd like to find the equivalent of:</p>
  
  <pre><code>#if COMPILING_WITH_10_5_OR_EARLIER
  blah
  #endif
  </code></pre>
  
  <p>Surely, there must be an easy way I've overlooked</p>