Files
Nim/tests/c/timportedsize.nim
metagn 94497c790b allow setting arbitrary size for importc types (#24868)
split from #24204, closes #7674

The `{.size.}` pragma no longer restricts the given size to 1, 2, 4 or 8
if it is used for an imported type. This is not tested very thoroughly
but there's no obvious reason to disallow it.

(cherry picked from commit 1ef9a656d2)
2025-04-14 10:53:01 +02:00

11 lines
126 B
Nim

{.emit: """
typedef struct Foo {
NI64 a;
NI64 b;
} Foo;
""".}
type Foo {.importc: "Foo", size: 16.} = object
var x: Foo