Skip to content

Expose static inline functions to bindings #123

@DeltaF1

Description

@DeltaF1

libctru has some functions that are static inline (I ran into getThreadCommandBuffer 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:

    --experimental \
    --wrap-static-fns \

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, but extern.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions