[OCaml] Fix %allowexception
OCaml's variableWrapper() wasn't calling emit_action_code() for in/out typemaps, which meant that %allowexception was being ignored. In addition, remove all comments in the typemaps in Lib/ocaml. In the case of the allowexcept test, one of the typemap comments caused compilation to fail because it became nested within another comment in an %exception block. Re-enable the allowexcept test. Add allowexcept_runme.ml.
This commit is contained in:
parent
7118e4ef1e
commit
4074f788b3
8 changed files with 20 additions and 50 deletions
|
|
@ -29,7 +29,6 @@ class wstring;
|
|||
|
||||
/* Overloading check */
|
||||
%typemap(in) string {
|
||||
/* %typemap(in) string */
|
||||
if (caml_ptr_check($input))
|
||||
$1.assign((char *)caml_ptr_val($input,0), caml_string_len($input));
|
||||
else
|
||||
|
|
@ -37,7 +36,6 @@ class wstring;
|
|||
}
|
||||
|
||||
%typemap(in) const string & ($*1_ltype temp) {
|
||||
/* %typemap(in) const string & */
|
||||
if (caml_ptr_check($input)) {
|
||||
temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input));
|
||||
$1 = &temp;
|
||||
|
|
@ -47,7 +45,6 @@ class wstring;
|
|||
}
|
||||
|
||||
%typemap(in) string & ($*1_ltype temp) {
|
||||
/* %typemap(in) string & */
|
||||
if (caml_ptr_check($input)) {
|
||||
temp.assign((char *)caml_ptr_val($input,0), caml_string_len($input));
|
||||
$1 = &temp;
|
||||
|
|
@ -57,7 +54,6 @@ class wstring;
|
|||
}
|
||||
|
||||
%typemap(in) string * ($*1_ltype *temp) {
|
||||
/* %typemap(in) string * */
|
||||
if (caml_ptr_check($input)) {
|
||||
temp = new $*1_ltype((char *)caml_ptr_val($input,0), caml_string_len($input));
|
||||
$1 = temp;
|
||||
|
|
@ -71,22 +67,18 @@ class wstring;
|
|||
}
|
||||
|
||||
%typemap(argout) string & {
|
||||
/* %typemap(argout) string & */
|
||||
swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size()));
|
||||
}
|
||||
|
||||
%typemap(directorout) string {
|
||||
/* %typemap(directorout) string */
|
||||
$result.assign((char *)caml_ptr_val($input,0), caml_string_len($input));
|
||||
}
|
||||
|
||||
%typemap(out) string {
|
||||
/* %typemap(out) string */
|
||||
$result = caml_val_string_len($1.c_str(),$1.size());
|
||||
}
|
||||
|
||||
%typemap(out) string * {
|
||||
/* %typemap(out) string * */
|
||||
$result = caml_val_string_len((*$1).c_str(),(*$1).size());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue