From: William S F. <ws...@fu...> - 2011-01-10 07:16:18
|
On 04/01/11 17:53, Joel Reymont wrote: > Folks, > > I took upon myself to update the OCaml portion of SWIG. I'm done except for std::string support. > > There's Lib/ocaml/std_string.i, included in stl.i. Then there's Examples/ocaml/stl that uses and sticks strings into std::vector<std::string>. > > Problem is, typemaps defined in std_string.i are never used and the example crashes. > Each target language should working with just the std_string.i library file: %include <std_string.i> I don't know what the state of Ocaml is in this respect though, but there are typemaps in this file. I don't know what you mean they are never used, as the test-suite uses this file in a number of places. It could well be the case that they don't work as no-one is maintaining or testing Ocaml. > I thought I would update OCaml to use typemaps_std_string but %include<typemaps/std_string.swg> gives me a syntax error. > > How do I enable typemaps_std_string for OCaml? > The typemaps/std_string.swg file has only been used by a subset of scripting languages. Usually a target language will convert to using all of the UTL (Unified Typemap Library) typemaps in the typemaps directory or none at all. I don't believe Ocaml uses any of the UTL at the moment, so I think your best bet is to avoid the UTL for a quick fix and fix what is in Lib/ocaml/std_string.i. William |