-
Notifications
You must be signed in to change notification settings - Fork 0
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
How to specify foreign import headers #333
Comments
My understanding is that users should specify header files using paths that are relative to an include directory, in which case we generate For the When manually configuring, users should configure both Am I missing or misunderstanding anything? |
I'm not fan of looking up extra information (system include paths, Cabal includes) if the opposite cost is just make user specify a bit more information. I think it will clarify when |
A quick clarification: in my understanding described above, it is up to the user to specify include directories relative to include paths (as configured by |
@TravisCardwell even if understand you, my point stands:
For TH usage nothing you said really make much sense, users would need to specify where to find the file, but also how include it from C anyway (and the latter may have a default for common cases). It might also make sense to always require some kind of wrapper header (so it's file local to package), even if it's literally just |
TL;DR I think it's time to work towards the real example, not just golden-fixture runs in our test-suite. There is a very simple TH test, and that can be extended; but Cabal/preprocessor usage is completely unexplored. |
👍 We should probably test against real examples using When using |
Related to #71 . |
For
CApiFFI
we need to include a header for declrations, e.g.However, with file-processing interface we don't know what's the canonical import. Is it
some-header.h
orclang-c/Index.h
(i.e. whether to drop directories or not).How to solve this?
Note: rust-bindgen doesn't have such problem as it doesn't have
CApiFFI
like system. If we use ordinary ForeignFunctionInterface, then the linker will find symbol, socapi
(but then we need to at least care about calling conventions)The text was updated successfully, but these errors were encountered: