title: how to check if condition in preprocessor macro?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/14002304/how-to-import-social-framework-only-for-ios-6">How to import Social framework only for iOS 6?</a>  </p>
  </blockquote>
  
  
  
  <p>Need of check if condition in preprocessor macro.</p>
  
  <pre><code>#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
  #define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
  #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
  #define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
  #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
  
  /*
   *  Usage
   */
  
  
  
  if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0"))
  {
  #import &lt;Social/SLServiceTypes.h&gt;
  #import &lt;Social/SLRequest.h&gt;
  #import &lt;Social/Social.h&gt;
  #import &lt;Social/SocialDefines.h&gt;
  }
  </code></pre>