ImportC with typedef anonymous enums

Chance Snow git at chancesnow.me
Fri Sep 1 02:10:15 UTC 2023


I am also experiencing this issue with the following C enum:

```c
// A list of all possible value types in WebAssembly.
typedef enum {
   // Signed 32 bit integer.
   I32,
   // Signed 64 bit integer.
   I64,
   // Floating point 32 bit integer.
   F32,
   // Floating point 64 bit integer.
   F64,
   // A 128 bit number.
   V128,
   // A reference to a Wasm function.
   FuncRef,
   // A reference to opaque data in the Wasm instance.
   ExternRef,
} ExtismValType;
```

On Wednesday, 9 November 2022 at 18:20:18 UTC, Imperatorn wrote:
> Just a sidenote, but for some reason, casting it like this 
> works:
> someFunc2((cast(typeof(my_struct.opts))eopt));

Not sure why, either, but this workaround also works for me.


More information about the Digitalmars-d mailing list