Add `membervariableHandler()` to the `OCAML` class in ocaml.cxx (it is partly based on the code in python.cxx and octave.cxx). In Lib/ocaml/class.swg, wrapped classes/structs were not being added to `class_master_list`. This is fixed by adding a call to `register_class_byname`. Add a unit test in the form of struct_value_runme.ml.
11 lines
300 B
OCaml
11 lines
300 B
OCaml
open Swig
|
|
open Struct_value
|
|
|
|
let b = new_Bar (C_void)
|
|
let a = (invoke b) "[a]" (C_void)
|
|
let _ = (invoke a) "[x]" (C_int 3)
|
|
let _ = assert((invoke a) "[x]" (C_void) = C_int 3)
|
|
|
|
let bb = (invoke b) "[b]" (C_void)
|
|
let _ = (invoke bb) "[x]" (C_int 3)
|
|
let _ = assert((invoke bb) "[x]" (C_void) = C_int 3)
|