This PR adds changes to the setup.py script to "bake" the defines used at compile time by generating a config.h file which is included in chipmunk.h.
This allows to change the types used for cpFloat (except for apple devices) plus the sizes of cpGroup, cpLayer and so on.
Additionally it exposes these types as the biggest possible types (uint64_t / double) on the cython side.
Currently cymunk.pxd exposes cpFloat as float while chipmunk uses by default doubles.
While cython will internally use the type defined in the .h file (double), the type defined in cython will be used to convert to/from python. Thus a number too big for a float will be returned to the python side as INFINITE. Too large integers will raise an OverflowError.
This PR adds changes to the
setup.py
script to "bake" the defines used at compile time by generating aconfig.h
file which is included inchipmunk.h
. This allows to change the types used for cpFloat (except for apple devices) plus the sizes of cpGroup, cpLayer and so on.Additionally it exposes these types as the biggest possible types (uint64_t / double) on the cython side. Currently
cymunk.pxd
exposes cpFloat as float while chipmunk uses by default doubles. While cython will internally use the type defined in the .h file (double), the type defined in cython will be used to convert to/from python. Thus a number too big for a float will be returned to the python side as INFINITE. Too large integers will raise anOverflowError
.I also removed the duplicate include folder.