Open yallop opened 8 years ago
/cc @simonjbeaumont
@yallop thanks for confirming the workaround too :)
I took the time to blog about the current workaround when these are required. http://simonjbeaumont.com/posts/ocaml-ctypes-flexible-array-member/
Thanks! These blog posts are extremely useful.
A common pattern in C libraries is to make the final member of a struct an array whose length is determined at runtime, like this example from the sanlock library:
Ctypes doesn't currently offer much/any support for this pattern, but it's sufficiently common that we ought to support it.