-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add C support #38
Add C support #38
Conversation
Looks great! One thing I'm considering is whether the system header parameter might instead be better served by splitting it up into multiple function calls. But I'll have you decide since I don't use C codegen :). |
Ah, I didn't think of that! I think it would improve readability to have |
Are things going OK? Would you like me to merge as-is? |
Sorry, I kinda got caught up in other stuff. I split |
Ah, good catch. I've removed the |
Thank you! |
PR that adds rudimentary support for C includes. Since C doesn't have a concept of "modules" we simply import items (which could be a function or variable) from files specified by path, with a boolean to distinguish system headers (such as
#include <stdio.h>
) from local headers (such as#include "foo/bar.h"
).Note that it considers
<stdio.h>
and"stdio.h"
to be different include files. We can let the C compiler sort out correctness - naming local headers with the same names as system headers that one is also using is incredibly bad practice.Added working example and doc test.
Addresses Issue #22