ocaml-ctypes icon indicating copy to clipboard operation
ocaml-ctypes copied to clipboard

fts example: foreign fails but stubgen suceeds on macos

Open avsm opened this issue 6 years ago • 1 comments

(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.

avsm avatar Dec 31 '18 17:12 avsm

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.

yallop avatar Jan 12 '19 20:01 yallop