Struct with Dynamic Layout

Ardika Rommy Sanjaya ardikars at gmail.com
Sat Aug 8 04:08:48 UTC 2020


In native c/c++ size of long is depends on the platform, ex "struct
timeval" in Unix and Windows has a different size.

// for unix
@NativeStruct("[i64(tv_sec)i32(tv_usec)x32](timeval)")

// for windows
@NativeStruct("[i32(tv_sec)i32(tv_usec)](timeval)")

Is it possible to create a new dynamic layout where I can use a single
struct class with different sizes on a different platform?

Thanks,
Rommy


More information about the panama-dev mailing list