Fixed datatype size + Bake defines#50
Open
SleepProgger wants to merge 1 commit into
Open
Conversation
+Fixed problem with type sizes
|
Doesn't work on Python 3, due to line 52 in setup.py - you use dict.iter_items, which in python 3 is dict.items |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds changes to the
setup.pyscript to "bake" the defines used at compile time by generating aconfig.hfile 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.pxdexposes 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.I also removed the duplicate include folder.