[ocaml-ctypes] Defines, and Structs with platform-specific fields

Trevor Smith trevorsummerssmith at gmail.com
Fri Oct 17 12:35:44 BST 2014


Hello,

I am working on a ctypes binding to libuv [https://github.com/joyent/libuv],
and I have two questions:

1) Is the recommended way to interact with C-defines the way described in
this thread?
http://lists.ocaml.org/pipermail/ctypes/2014-February/000064.html

2) What is the recommended way to deal with struct fields that vary
depending upon platform?

Libuv is a cross platform library, and has platform-specific fields for its
structs. For example see the struct uv_loop_s.

Defined here https://github.com/joyent/libuv/blob/v1.0.0-rc1/include/uv.h
Unix specific fields:
https://github.com/joyent/libuv/blob/v1.0.0-rc1/include/uv-unix.h
Windows specific fields:
https://github.com/joyent/libuv/blob/v1.0.0-rc1/include/uv-win.h

Thank you.

Trevor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/ctypes/attachments/20141017/d31beee7/attachment.html>


More information about the Ctypes mailing list