title: How to determine if compiling for 64-bit iOS in Xcode
body: <p>Consider the following function</p>
  
  <pre><code>CGSize CGSizeIntegral(CGSize size)
  {
      return CGSizeMake(ceilf(size.width), ceilf(size.height));
  }
  </code></pre>
  
  <p><code>CGSize</code> actually consists of two <code>CGFloat</code>s, and <code>CGFloat</code>'s definition changes depending on the architecture:</p>
  
  <pre><code>typedef float CGFloat;// 32-bit
  typedef double CGFloat;// 64-bit
  </code></pre>
  
  <p>So, the above code is wrong on 64-bit systems, and needs to be updated with something like</p>
  
  <pre><code>CGSize CGSizeIntegral(CGSize size)
  {
  #if 64_bit
      return CGSizeMake(ceil(size.width), ceil(size.height));
  #else
      return CGSizeMake(ceilf(size.width), ceilf(size.height));
  #endif
  }
  </code></pre>
  
  <p>There is surely a compiler macro/constant for this (for Mac we can use <code>INTEL_X86</code> for example) but I haven't been able to find this in the <a href="https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html">64-bit transition guide</a>.</p>
  
  <p><strong>How can I determine what architecture is being built for?</strong></p>