Add varargs to defines, defines as C imports, and CLI mangle option #222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey! Thanks for keeping
c2nim
up and working!I decided to take the time to fix/tweak a few things that I run into a lot and figure others might find them useful.
#defines
macro functions as external C functions usingimportc
pragma#defines
constants as external C var's usingimportc
#define
macro functions supporting templatesargs: seq[untyped]
#define
macro functions supporting C imports with{.varargs.}
pragmauint8_t
types from<stdint.h>
)I'll work on adding the test cases I'm using tomorrow. I haven't run the test suite yet, but I'll do that tomorrow. However, I wanted to get this up so I wouldn't forget to PR it later.
Also, any feedback/changes would be great. I tried to follow the coding style as much as I could. Still I'm not entirely familiar with the correct
PNode
structures for some of the items. Particularly if there's a "proper" way to handle some of the constructs.