-
Notifications
You must be signed in to change notification settings - Fork 352
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
Unified the FFI by eliminating public static inline functions #79
Conversation
Under the assumption that it does not declares a public interface of any kind, but rather defines pointers to functions when compiling.
A separate translation unit is now responsible for generating exports, as recommended by section 6.7.4 of the ISO C standard This completes the task in *include/chipmunk/chipmunk_ffi.h*: // TODO: get rid of the reliance on static inlines. // They make a mess for FFIs. Legacy function pointers are still supported, though the use of -DCHIPMUNK_LEGACY_FFI. An additional option in cmake makes it easy to enable or disable this feature. Eventually, it can be removed completely.
@samvv This fixes compilation errors with building chipmunk library, but the demos still have a compilation error. Do they need to be updated to the new API?
|
@andrewrk You're right, totally forgot to test it on the demos! I will look into it when I have the time. |
Just a minor feedback since this is already frozen since august: if someone still wants to see this added he or she will have to look into it, because I won't, unfortunately. |
Found some time; see the new pull #139 for a new version. |
The FFI no longer consists of function pointers, which makes it much easier to import them in other programs/languages. Public functions that were declared
static inline
are now justinline
and exported in a seperate translation unit, as recommended by section 6.7.4 of the ISO C standardSomething similar was already noted in include/chipmunk/chipmunk_ffi.h:
Legacy function pointers are still supported, though the use of
-DCHIPMUNK_LEGACY_FFI
. An additional option in cmake makes it easy toenable or disable this feature. Eventually, it can be removed completely.
There were also a few inlude-directives in
src/
that were inconsistent with some other files; I have changed them to what I thought they should be.Tested on Ubuntu 14.04 with GCC 4.8.2.