Consider the following function
CGSize CGSizeIntegral(CGSize size)
{
return CGSizeMake(ceilf(size.width), ceilf(size.height));
}
CGSize
actually consists of two CGFloat
s, and CGFloat
's definition changes depending on the architecture:
typedef float CGFloat;// 32-bit
typedef double CGFloat;// 64-bit
So, the above code is wrong on 64-bit systems, and needs to be updated with something like
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
}
There is surely a compiler macro/constant for this (for Mac we can use INTEL_X86
for example) but I haven't been able to find this in the 64-bit transition guide.
How can I determine what architecture is being built for?