-
Notifications
You must be signed in to change notification settings - Fork 18
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
Expose static inline functions to bindings #123
Comments
@ian-h-chamberlain @AzureMarker Do you think we should add experimental options to I'm asking because I intend on merging #110, so I could add this in if you think it's fine. |
If we do add it, it should be a separate PR. I do like having increased coverage of the libctru static functions, but since we already converted the common ones I'm not sure that we need to do this refactor now. Feel free to go ahead and open a PR for it though if someone gets it working. |
I'd echo the same, the new bindgen feature seems nice but a separate PR would probably be good just to make it easier to review, since some of the manually-ported functions would have to get removed. At first I was thinking the requirement to build an extra C source file would be kind of troublesome, but I suppose it should always work since we already have a build dependency on the devkitPro toolchain. |
libctru has some functions that are
static inline
(I ran intogetThreadCommandBuffer
specifically) and so are not exposed by bindgen by default.rust-lang/rust-bindgen#2335 adds a feature to generate bindings for such functions. I got as far as adding these arguments to bindgen.sh:
which adds the missing functions to bindings.rs, and generates a C file with wrapper functions in
/tmp/bindgen/extern.c
. I don't understand build processes enough to proceed from this point, butextern.c
needs to be compiled and then linked with the library. Here's a link discussing how to do this and also about how to enable LTO so that ctru-rs can benefit from inlining those functions. I believe this also depends upon #110 fixing the__getreent
issue.The text was updated successfully, but these errors were encountered: