From c5d4f0f706c02f645bb564273ddf47815af8ca32 Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Mon, 6 Jun 2016 20:30:21 +0100 Subject: [PATCH 1/2] Travis: build the inverted stubs example. --- .travis-ci.sh | 9 +++++++++ 1 file changed, 9 insertions(+) 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 + From f8a1c3d54e0922aad7e44914cde652949d43b54d Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Mon, 6 Jun 2016 20:48:29 +0100 Subject: [PATCH 2/2] Replicate the Ctypes.fn datatype in the inverted stubs file. --- src/cstubs/cstubs_inverted.ml | 3 +++ 1 file changed, 3 insertions(+) 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