Skip to content

libc interop for opaque types #2599

Answered by pvdrz
jedbrown asked this question in Q&A
Aug 4, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

There's no feature that does exactly that, but you can do something like it by combining two features:

  • First you need to call blocklist_type with FILE so there's no definition for FILE anywhere in your bindings. Given that blocklist methods are not recursive/transitive, all the uses of FILE in your bindings will still be present.

  • Then you call raw_line with use libc::FILE;. Given that libc::FILE and FILE are the same type, they should be ABI compatible.

Let me know if this fixes your issue.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jedbrown
Comment options

@pvdrz
Comment options

Answer selected by jedbrown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants