Page 1 of 1

OS X cpFloat is float instead of double

Posted: Wed Feb 10, 2010 3:28 am
by erikc
In chipmunk_types.h:

// Use single precision floats on the iPhone.
#ifdef TARGET_OS_IPHONE
#define CP_USE_DOUBLES 0
#else
// use doubles by default for higher precision
#define CP_USE_DOUBLES 1
#endif

I believe the #ifdef should be an #if, since TARGET_OS_IPHONE is defined to 0 for OS X builds. This is causing cpFloat to be a float typedef instead of a double typedef on OS X. Ran into this when writing bindings to the Factor programming language.

Re: OS X cpFloat is float instead of double

Posted: Wed Feb 10, 2010 9:39 am
by slembcke
Hmm. Didn't happen for me on 10.5 with XCode 3.1.4, but I would certainly believe it if that changed.

I changed it to a #if TARGET_OS_IPHONE==1 in trunk. I'll be doing a new release soon with the new performance improvements and fixes. Hopefully in the next week or two before GDC.