diff --git a/.travis-ci.sh b/.travis-ci.sh index 0a569df6..ab25dc7d 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -59,3 +59,12 @@ opam install mirage-xen || echo "Mirage not installable, so not testing Xen buil opam pin add -n ctypes $(pwd) opam install --build-test --yes ctypes + +# Check that the inverted stubs package builds with this release +opam pin add -n ctypes-inverted-stubs-example https://github.com/yallop/ocaml-ctypes-inverted-stubs-example.git +if test ! $COVERAGE && opam install --show-actions ctypes-inverted-stubs-example; then + opam install --build-test --yes ctypes-inverted-stubs-example +else + echo "Pinning the inverted stubs example failed, probably due to OCaml version incompatibility" +fi + diff --git a/src/cstubs/cstubs_inverted.ml b/src/cstubs/cstubs_inverted.ml index 961b7e02..e945ce67 100644 --- a/src/cstubs/cstubs_inverted.ml +++ b/src/cstubs/cstubs_inverted.ml @@ -130,6 +130,9 @@ let gen_ml fmt register (infos : fn_info list) : unit = "type 'a fn = 'a@\n@\n"; Format.fprintf fmt "module CI = Cstubs_internals@\n@\n"; + Format.fprintf fmt "type 'a f = 'a CI.fn =@\n"; + Format.fprintf fmt " | Returns : 'a CI.typ -> 'a f@\n"; + Format.fprintf fmt " | Function : 'a CI.typ * 'b f -> ('a -> 'b) f@\n"; Format.fprintf fmt "type 'a name = @\n"; ListLabels.iter infos