-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
{.byref,exportc.} types are not output into --header file #19445
Comments
Note: in case you're wondering why I'm using the I could potentially work around this by generating data as assembly instead of C, but that comes with its own issues as I'd lose a layer of protection with the C compiler no longer being able to check that the data matches the type, and I'd have to generate different assembly when compiling the project for different platforms, etc. |
It's only a problem since it's a regression as |
I will try |
Hello, I cannot compile the program with Nim 1.4.8, Nim 1.6.0 (same errors as 1.6.2 and devel)? Anything I did wrong?
|
Huh, you're right, I thought I tested this pretty thoroughly but clearly my example failed to capture the regression. Apologies. I've updated the example slightly (changed Honestly though, don't let this block the 1.6.4 release. It's not that important. 1.6.0:
1.6.2:
|
I found the culprit and will push a fix soon. |
* output byref types into --header file fix #19445 * fix comments * set targets
* output byref types into --header file fix nim-lang#19445 * fix comments * set targets
When an object type is made available to C code via {.exportc.} in combination with the
--header
option, the full type definition doesn't appear in the generated<project>.h
. (unless the type is small, or is explicitly annotated with {.bycopy.})Previously this worked fine as long as you also had an {.exportc.}'d procedure that made use of the type, see #7448 (comment).
Example
Compile with
nim c -r --nimcache:nimcache --cincludes:nimcache --header main.nim
Current Output
The generated
main.h
:Expected Output
Program should compile.
Additional Information
The issue occurs on 1.6.2 and the 1.6.4 RC, but not on 1.6.0 or earlier.
The text was updated successfully, but these errors were encountered: