[ocaml-ctypes] Spinning process on osx

Daniel Bünzli daniel.buenzli at erratique.ch
Thu Jan 30 12:59:05 GMT 2014


Le jeudi, 30 janvier 2014 à 11:39, Jeremy Yallop a écrit :
> Here's an example that checks function availability during stub generation
> and generates either a working stub or a function that raises an
> exception.

In fact you really need to look them up dynamically (e.g. if you want to distribute binaries). What do you think about this approach (which is basically the technique I wrote about here [1]). Would I be able doable with the current stub generation ?

1) Lookup function pointer with Dl.dlsym. which results in an otptional fun ptr.
2) Generate stub that has a fun ptr as a first argument, in the stub if fun ptr is None, raise, otherwise invoke.  

Best,

Daniel

[1] http://lists.ocaml.org/pipermail/ctypes/2013-December/000033.html


More information about the Ctypes mailing list