From 050629536ab7e195bb1fe076e77e8c4043d563bb Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Thu, 21 Feb 2013 18:53:29 +0000 Subject: [PATCH] ML API: bugfix Signed-off-by: Christoph M. Wintersteiger --- examples/ml/Makefile | 4 ++-- scripts/update_api.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/ml/Makefile b/examples/ml/Makefile index a7f8e6ee0..818f0cacc 100644 --- a/examples/ml/Makefile +++ b/examples/ml/Makefile @@ -3,5 +3,5 @@ # in the top-level build directory. all: - OCAML_COMPAT=c C:/ocamlw32/bin/ocamlc -g -annot -o ml_example.byte -I ../../bld_dbg -I ../../bld_dbg/api/ml z3.cma ml_example.ml - C:/ocamlw32/bin/ocamlopt -g -annot -o ml_example -I ../../bld_dbg -I ../../bld_dbg/api/ml z3.cmxa ml_example.ml + source /cygdrive/c/cwinter/.msenv32 ; OCAML_COMPAT=c C:/ocamlw32/bin/ocamlc -g -custom -cclib '-L../../bld_dbg -lz3' -annot -o ml_example.byte -I ../../bld_dbg/api/ml z3.cma ml_example.ml + source /cygdrive/c/cwinter/.msenv32 ; C:/ocamlw32/bin/ocamlopt -g -annot -o ml_example -cclib '-L../../bld_dbg -lz3' -I ../../bld_dbg -I ../../bld_dbg/api/ml z3.cmxa ml_example.ml diff --git a/scripts/update_api.py b/scripts/update_api.py index a0b7e6250..44d871348 100644 --- a/scripts/update_api.py +++ b/scripts/update_api.py @@ -1339,9 +1339,10 @@ def mk_ml(): ml_wrapper.write(' // upon errors, but the actual error handling is done by throwing exceptions in the\n') ml_wrapper.write(' // wrappers below.\n') ml_wrapper.write('}\n\n') - ml_wrapper.write('void n_set_internal_error_handler(Z3_context c)\n') + ml_wrapper.write('void n_set_internal_error_handler(value a0)\n') ml_wrapper.write('{\n') - ml_wrapper.write(' Z3_set_error_handler(c, MLErrorHandler);\n') + ml_wrapper.write(' Z3_context _a0 = * (Z3_context*) Data_custom_val(a0);\n') + ml_wrapper.write(' Z3_set_error_handler(_a0, MLErrorHandler);\n') ml_wrapper.write('}\n\n') for name, result, params in _dotnet_decls: ip = inparams(params)