ocaml-ctypes
ocaml-ctypes copied to clipboard
fts example: foreign fails but stubgen suceeds on macos
(Just keeping track of this bug while working on #574)
On macos, the examples/fts/foreign version fails due to getting an invalid argument back for fts_info, but the stubgen one succeeds.
$ ./_build/fts.native .
Fatal error: exception Invalid_argument("fts_info")
It seems to be a different number every time for fts_info_of_int, so needs more investigation.
This is quite likely due to different struct layouts for ftsent
. For example, on Linux, fts_pathlen
(which appears before fts_info
) is an unsigned short, whereas on BSD it's a size_t
. The stubgen test succeeds because it recovers the offsets from the C API rather than computing them from the OCaml code.