From 93008f32ba84c282dfeae2c8d9cc9c1a5688bca5 Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Sat, 1 Nov 2003 06:10:50 +0000 Subject: [PATCH] Slight type adjustment for invoke. This makes swigp4 a bit easier to deal with. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5230 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/ocaml/swig.ml | 2 +- SWIG/Lib/ocaml/swig.mli | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SWIG/Lib/ocaml/swig.ml b/SWIG/Lib/ocaml/swig.ml index ff58fc575..60917c57e 100644 --- a/SWIG/Lib/ocaml/swig.ml +++ b/SWIG/Lib/ocaml/swig.ml @@ -31,7 +31,7 @@ exception NotObject of empty_enum c_obj_t exception NotEnumType of empty_enum c_obj_t exception LabelNotFromThisEnum of empty_enum c_obj_t -let invoke obj = match obj with C_obj o -> o | _ -> raise (NotObject obj) +let invoke obj = match obj with C_obj o -> o | _ -> raise (NotObject (Obj.magic obj)) let _ = Callback.register "swig_runmethod" invoke let fnhelper fin f arg = let args = match arg with C_list l -> l | C_void -> [] | _ -> [ arg ] in diff --git a/SWIG/Lib/ocaml/swig.mli b/SWIG/Lib/ocaml/swig.mli index bc3673a7d..e7198b73b 100644 --- a/SWIG/Lib/ocaml/swig.mli +++ b/SWIG/Lib/ocaml/swig.mli @@ -20,6 +20,7 @@ type 'a c_obj_t = | C_enum of 'a | C_director_core of 'a c_obj_t * 'a c_obj_t option ref +val invoke : 'a c_obj_t -> (string -> 'a c_obj_t -> 'a c_obj_t) val convert_c_obj : 'a c_obj_t -> 'b c_obj_t val get_int : 'a c_obj_t -> int