You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently came across one Nim object mapped to a C struct using nimterop that caused compilation failure only when I used sizeof to calculate the size of that struct.
Hello,
I recently came across one Nim object mapped to a C struct using nimterop that caused compilation failure only when I used
sizeof
to calculate the size of that struct.Here's the relevant snippet from
svdpi.h
:Here's what Nimterop parses that to:
The code is functionally correct. But when I use
sizeof
on an object of typesvLogicVecVal
, I get:Looking around on Nim Forum, I found this post by @timotheecour and that helped!
I then put this in
svdpi.nim
, with thecompleteStruct
pragma and everything worked:I don't completely understand why that pragma is needed in the first place.
Should nimterop be adding the
completeStruct
pragma automatically?Reference code
Versions
The text was updated successfully, but these errors were encountered: