Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CGFloat as the float type if CP_USE_CGTYPES is set. #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use CGFloat as the float type if CP_USE_CGTYPES is set. #154

wants to merge 1 commit into from

Conversation

DagAgren
Copy link
Contributor

@DagAgren DagAgren commented Sep 3, 2017

When bridging this library into Swift, the stricter typing means that all the CGFloat values from UIKit have to be cast back and forth from cpFloat. With this change, cpFloat is typedefed CGFloat if CP_USE_CGTYPES is set, which means no casts are required. This should have no effect when used from C, as CGFloat should be either float or double depending on the same conditions as cpFloat uses.

@slembcke
Copy link
Owner

Are equivalent C types still handled this way in Swift? I was hoping to try to cleanup and simplify the macro gobbledygook in chipmunk_types.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants