Hi,

I'm trying to bind libmemphis with ctypes and I encounter some problems with one function in particular:
https://github.com/LamaUrbain/ocaml-memphis/blob/master/src/memphis_renderer.ml#L55

The function takes a cairo_t in C but in OCaml I would like to use Cairo.context. So I tried by using Obj.magic in the overloading just below (in the code linked above) but when I try to use the function it segfaults in some random cairo function (memphis_renderer_draw_tile is called before and seems to work).

Is there an other way to use an OCaml type (Cairo.context) instead of the abstract C type or the problem might comes from somewhere else ?

Cheers,
_______________________________________________
Ctypes mailing list
[email protected]
http://lists.ocaml.org/listinfo/ctypes

Reply via email to