Merge branch 'ZackerySpytz-OCaml-director-ctors'
* ZackerySpytz-OCaml-director-ctors: [OCaml] Fix a bug in the ctors of director classes
This commit is contained in:
commit
d7bb500315
5 changed files with 45 additions and 6 deletions
|
|
@ -70,6 +70,11 @@ class wstring;
|
|||
swig_result = caml_list_append(swig_result,caml_val_string_len((*$1).c_str(), (*$1).size()));
|
||||
}
|
||||
|
||||
%typemap(directorin) string {
|
||||
swig_result = caml_val_string_len($1.c_str(), $1.size());
|
||||
args = caml_list_append(args, swig_result);
|
||||
}
|
||||
|
||||
%typemap(directorout) string {
|
||||
$result.assign((char *)caml_ptr_val($input,0), caml_string_len($input));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,13 @@ let _ = Callback.register "swig_runmethod" invoke
|
|||
let fnhelper arg =
|
||||
match arg with C_list l -> l | C_void -> [] | _ -> [ arg ]
|
||||
|
||||
let director_core_helper fnargs =
|
||||
try
|
||||
match List.hd fnargs with
|
||||
| C_director_core (o,r) -> fnargs
|
||||
| _ -> C_void :: fnargs
|
||||
with Failure _ -> C_void :: fnargs
|
||||
|
||||
let rec get_int x =
|
||||
match x with
|
||||
C_bool b -> if b then 1 else 0
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ exception NoSuchClass of string
|
|||
|
||||
val invoke : ('a c_obj_t) -> (string -> 'a c_obj_t -> 'a c_obj_t)
|
||||
val fnhelper : 'a c_obj_t -> 'a c_obj_t list
|
||||
val director_core_helper : 'a c_obj_t list -> 'a c_obj_t list
|
||||
|
||||
val get_int : 'a c_obj_t -> int
|
||||
val get_float : 'a c_obj_t -> float
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue