From 95f12a430ee8ca80081c6ba2871179dad260386e Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Thu, 14 Jul 2016 11:19:42 +0100 Subject: [PATCH 1/2] Switch errno from int (31 or 63 bits) to Ctypes.sint (32 or 64 bits). --- lib/_tags | 3 +- lib/errno.ml | 319 +++++++++++++++++---------------- lib/errno.mli | 316 ++++++++++++++++---------------- lib_gen/unix_errno_bindings.ml | 140 +++++++-------- lib_gen/unix_errno_types.ml | 170 +++++++++--------- src/_tags | 1 + src/errno_srcgen.ml | 2 +- unix/errno_unix.ml | 8 +- unix/errno_unix.mli | 4 +- 9 files changed, 483 insertions(+), 480 deletions(-) diff --git a/lib/_tags b/lib/_tags index 5777458..3904be0 100644 --- a/lib/_tags +++ b/lib/_tags @@ -1 +1,2 @@ -<*.{ml,mli}>: package(bytes), package(result) +<*.{ml,mli}>: package(bytes), package(result), package(ctypes) + diff --git a/lib/errno.ml b/lib/errno.ml index 43c973c..789ac79 100644 --- a/lib/errno.ml +++ b/lib/errno.ml @@ -170,7 +170,7 @@ type t = | ENODATA | ETIME | ENOSR - | EUNKNOWNERR of int + | EUNKNOWNERR of Signed.sint type error = { errno : t list; @@ -181,163 +181,163 @@ type error = { exception Error of error type defns = { - e2big : int option; - eacces : int option; - eaddrinuse : int option; - eaddrnotavail : int option; - eafnosupport : int option; - eagain : int option; - ealready : int option; - ebadf : int option; - ebadmsg : int option; - ebusy : int option; - ecanceled : int option; - echild : int option; - econnaborted : int option; - econnrefused : int option; - econnreset : int option; - edeadlk : int option; - edestaddrreq : int option; - edom : int option; - edquot : int option; - eexist : int option; - efault : int option; - efbig : int option; - ehostdown : int option; - ehostunreach : int option; - eidrm : int option; - eilseq : int option; - einprogress : int option; - eintr : int option; - einval : int option; - eio : int option; - eisconn : int option; - eisdir : int option; - eloop : int option; - emfile : int option; - emlink : int option; - emsgsize : int option; - emultihop : int option; - enametoolong : int option; - enetdown : int option; - enetreset : int option; - enetunreach : int option; - enfile : int option; - enobufs : int option; - enodev : int option; - enoent : int option; - enoexec : int option; - enolck : int option; - enolink : int option; - enomem : int option; - enomsg : int option; - enoprotoopt : int option; - enospc : int option; - enosys : int option; - enotblk : int option; - enotconn : int option; - enotdir : int option; - enotempty : int option; - enotrecoverable : int option; - enotsock : int option; - enotsup : int option; - enotty : int option; - enxio : int option; - eopnotsupp : int option; - eoverflow : int option; - eownerdead : int option; - eperm : int option; - epfnosupport : int option; - epipe : int option; - eproto : int option; - eprotonosupport : int option; - eprototype : int option; - erange : int option; - eremote : int option; - erofs : int option; - eshutdown : int option; - esocktnosupport : int option; - espipe : int option; - esrch : int option; - estale : int option; - etimedout : int option; - etoomanyrefs : int option; - etxtbsy : int option; - eusers : int option; - ewouldblock : int option; - exdev : int option; - echrng : int option; - el2nsync : int option; - el3hlt : int option; - el3rst : int option; - elnrng : int option; - eunatch : int option; - enocsi : int option; - el2hlt : int option; - ebade : int option; - ebadr : int option; - exfull : int option; - enoano : int option; - ebadrqc : int option; - ebadslt : int option; - ebfont : int option; - enonet : int option; - enopkg : int option; - eadv : int option; - esrmnt : int option; - ecomm : int option; - edotdot : int option; - enotuniq : int option; - ebadfd : int option; - eremchg : int option; - elibacc : int option; - elibbad : int option; - elibscn : int option; - elibmax : int option; - elibexec : int option; - erestart : int option; - estrpipe : int option; - euclean : int option; - enotnam : int option; - enavail : int option; - eisnam : int option; - eremoteio : int option; - enomedium : int option; - emediumtype : int option; - enokey : int option; - ekeyexpired : int option; - ekeyrevoked : int option; - ekeyrejected : int option; - erfkill : int option; - ehwpoison : int option; - epwroff : int option; - edeverr : int option; - ebadexec : int option; - ebadarch : int option; - eshlibvers : int option; - ebadmacho : int option; - enopolicy : int option; - eqfull : int option; - edoofus : int option; - enotcapable : int option; - ecapmode : int option; - eproclim : int option; - ebadrpc : int option; - erpcmismatch : int option; - eprogunavail : int option; - eprogmismatch : int option; - eprocunavail : int option; - eftype : int option; - eauth : int option; - eneedauth : int option; - enoattr : int option; - enostr : int option; - enodata : int option; - etime : int option; - enosr : int option; + e2big : Signed.sint option; + eacces : Signed.sint option; + eaddrinuse : Signed.sint option; + eaddrnotavail : Signed.sint option; + eafnosupport : Signed.sint option; + eagain : Signed.sint option; + ealready : Signed.sint option; + ebadf : Signed.sint option; + ebadmsg : Signed.sint option; + ebusy : Signed.sint option; + ecanceled : Signed.sint option; + echild : Signed.sint option; + econnaborted : Signed.sint option; + econnrefused : Signed.sint option; + econnreset : Signed.sint option; + edeadlk : Signed.sint option; + edestaddrreq : Signed.sint option; + edom : Signed.sint option; + edquot : Signed.sint option; + eexist : Signed.sint option; + efault : Signed.sint option; + efbig : Signed.sint option; + ehostdown : Signed.sint option; + ehostunreach : Signed.sint option; + eidrm : Signed.sint option; + eilseq : Signed.sint option; + einprogress : Signed.sint option; + eintr : Signed.sint option; + einval : Signed.sint option; + eio : Signed.sint option; + eisconn : Signed.sint option; + eisdir : Signed.sint option; + eloop : Signed.sint option; + emfile : Signed.sint option; + emlink : Signed.sint option; + emsgsize : Signed.sint option; + emultihop : Signed.sint option; + enametoolong : Signed.sint option; + enetdown : Signed.sint option; + enetreset : Signed.sint option; + enetunreach : Signed.sint option; + enfile : Signed.sint option; + enobufs : Signed.sint option; + enodev : Signed.sint option; + enoent : Signed.sint option; + enoexec : Signed.sint option; + enolck : Signed.sint option; + enolink : Signed.sint option; + enomem : Signed.sint option; + enomsg : Signed.sint option; + enoprotoopt : Signed.sint option; + enospc : Signed.sint option; + enosys : Signed.sint option; + enotblk : Signed.sint option; + enotconn : Signed.sint option; + enotdir : Signed.sint option; + enotempty : Signed.sint option; + enotrecoverable : Signed.sint option; + enotsock : Signed.sint option; + enotsup : Signed.sint option; + enotty : Signed.sint option; + enxio : Signed.sint option; + eopnotsupp : Signed.sint option; + eoverflow : Signed.sint option; + eownerdead : Signed.sint option; + eperm : Signed.sint option; + epfnosupport : Signed.sint option; + epipe : Signed.sint option; + eproto : Signed.sint option; + eprotonosupport : Signed.sint option; + eprototype : Signed.sint option; + erange : Signed.sint option; + eremote : Signed.sint option; + erofs : Signed.sint option; + eshutdown : Signed.sint option; + esocktnosupport : Signed.sint option; + espipe : Signed.sint option; + esrch : Signed.sint option; + estale : Signed.sint option; + etimedout : Signed.sint option; + etoomanyrefs : Signed.sint option; + etxtbsy : Signed.sint option; + eusers : Signed.sint option; + ewouldblock : Signed.sint option; + exdev : Signed.sint option; + echrng : Signed.sint option; + el2nsync : Signed.sint option; + el3hlt : Signed.sint option; + el3rst : Signed.sint option; + elnrng : Signed.sint option; + eunatch : Signed.sint option; + enocsi : Signed.sint option; + el2hlt : Signed.sint option; + ebade : Signed.sint option; + ebadr : Signed.sint option; + exfull : Signed.sint option; + enoano : Signed.sint option; + ebadrqc : Signed.sint option; + ebadslt : Signed.sint option; + ebfont : Signed.sint option; + enonet : Signed.sint option; + enopkg : Signed.sint option; + eadv : Signed.sint option; + esrmnt : Signed.sint option; + ecomm : Signed.sint option; + edotdot : Signed.sint option; + enotuniq : Signed.sint option; + ebadfd : Signed.sint option; + eremchg : Signed.sint option; + elibacc : Signed.sint option; + elibbad : Signed.sint option; + elibscn : Signed.sint option; + elibmax : Signed.sint option; + elibexec : Signed.sint option; + erestart : Signed.sint option; + estrpipe : Signed.sint option; + euclean : Signed.sint option; + enotnam : Signed.sint option; + enavail : Signed.sint option; + eisnam : Signed.sint option; + eremoteio : Signed.sint option; + enomedium : Signed.sint option; + emediumtype : Signed.sint option; + enokey : Signed.sint option; + ekeyexpired : Signed.sint option; + ekeyrevoked : Signed.sint option; + ekeyrejected : Signed.sint option; + erfkill : Signed.sint option; + ehwpoison : Signed.sint option; + epwroff : Signed.sint option; + edeverr : Signed.sint option; + ebadexec : Signed.sint option; + ebadarch : Signed.sint option; + eshlibvers : Signed.sint option; + ebadmacho : Signed.sint option; + enopolicy : Signed.sint option; + eqfull : Signed.sint option; + edoofus : Signed.sint option; + enotcapable : Signed.sint option; + ecapmode : Signed.sint option; + eproclim : Signed.sint option; + ebadrpc : Signed.sint option; + erpcmismatch : Signed.sint option; + eprogunavail : Signed.sint option; + eprogmismatch : Signed.sint option; + eprocunavail : Signed.sint option; + eftype : Signed.sint option; + eauth : Signed.sint option; + eneedauth : Signed.sint option; + enoattr : Signed.sint option; + enostr : Signed.sint option; + enodata : Signed.sint option; + etime : Signed.sint option; + enosr : Signed.sint option; } -type index = (int, t) Hashtbl.t +type index = (Signed.sint, t) Hashtbl.t let empty_defns = { e2big = None; @@ -971,7 +971,7 @@ let to_string = function | ENODATA -> "ENODATA" | ETIME -> "ETIME" | ENOSR -> "ENOSR" - | EUNKNOWNERR x -> "EUNKNOWNERR_"^(string_of_int x) + | EUNKNOWNERR x -> "EUNKNOWNERR_"^(Signed.SInt.to_string x) let of_string = function | "E2BIG" -> Some E2BIG @@ -1459,7 +1459,8 @@ let string_of_defns defns = let buf = Buffer.create 1024 in iter_defns defns (fun code symbol -> - Buffer.add_string buf (Printf.sprintf "%s\t%d\n" (to_string symbol) code) + Buffer.add_string buf (Printf.sprintf "%s\t%s\n" (to_string symbol) + (Signed.SInt.to_string code)) ) (fun symbol -> Buffer.add_string buf (Printf.sprintf "%s\t\n" (to_string symbol)) @@ -1471,7 +1472,7 @@ let defns_of_string s = try let symbol, code, off = Scanf.sscanf s "%s\t%s\n" (fun symbol_s code_s -> of_string symbol_s, - (if code_s = "" then None else Some (int_of_string code_s)), + (if code_s = "" then None else Some (Signed.SInt.of_string code_s)), String.(length symbol_s + 1 + length code_s + 1) ) in let defns = match symbol with diff --git a/lib/errno.mli b/lib/errno.mli index 6c3f7d7..5986ec8 100644 --- a/lib/errno.mli +++ b/lib/errno.mli @@ -170,7 +170,7 @@ type t = | ENODATA | ETIME | ENOSR - | EUNKNOWNERR of int + | EUNKNOWNERR of Signed.sint type error = { errno : t list; @@ -183,160 +183,160 @@ exception Error of error (** NB: This module registers a printer for the [Error] exception. *) type defns = { - e2big : int option; - eacces : int option; - eaddrinuse : int option; - eaddrnotavail : int option; - eafnosupport : int option; - eagain : int option; - ealready : int option; - ebadf : int option; - ebadmsg : int option; - ebusy : int option; - ecanceled : int option; - echild : int option; - econnaborted : int option; - econnrefused : int option; - econnreset : int option; - edeadlk : int option; - edestaddrreq : int option; - edom : int option; - edquot : int option; - eexist : int option; - efault : int option; - efbig : int option; - ehostdown : int option; - ehostunreach : int option; - eidrm : int option; - eilseq : int option; - einprogress : int option; - eintr : int option; - einval : int option; - eio : int option; - eisconn : int option; - eisdir : int option; - eloop : int option; - emfile : int option; - emlink : int option; - emsgsize : int option; - emultihop : int option; - enametoolong : int option; - enetdown : int option; - enetreset : int option; - enetunreach : int option; - enfile : int option; - enobufs : int option; - enodev : int option; - enoent : int option; - enoexec : int option; - enolck : int option; - enolink : int option; - enomem : int option; - enomsg : int option; - enoprotoopt : int option; - enospc : int option; - enosys : int option; - enotblk : int option; - enotconn : int option; - enotdir : int option; - enotempty : int option; - enotrecoverable : int option; - enotsock : int option; - enotsup : int option; - enotty : int option; - enxio : int option; - eopnotsupp : int option; - eoverflow : int option; - eownerdead : int option; - eperm : int option; - epfnosupport : int option; - epipe : int option; - eproto : int option; - eprotonosupport : int option; - eprototype : int option; - erange : int option; - eremote : int option; - erofs : int option; - eshutdown : int option; - esocktnosupport : int option; - espipe : int option; - esrch : int option; - estale : int option; - etimedout : int option; - etoomanyrefs : int option; - etxtbsy : int option; - eusers : int option; - ewouldblock : int option; - exdev : int option; - echrng : int option; - el2nsync : int option; - el3hlt : int option; - el3rst : int option; - elnrng : int option; - eunatch : int option; - enocsi : int option; - el2hlt : int option; - ebade : int option; - ebadr : int option; - exfull : int option; - enoano : int option; - ebadrqc : int option; - ebadslt : int option; - ebfont : int option; - enonet : int option; - enopkg : int option; - eadv : int option; - esrmnt : int option; - ecomm : int option; - edotdot : int option; - enotuniq : int option; - ebadfd : int option; - eremchg : int option; - elibacc : int option; - elibbad : int option; - elibscn : int option; - elibmax : int option; - elibexec : int option; - erestart : int option; - estrpipe : int option; - euclean : int option; - enotnam : int option; - enavail : int option; - eisnam : int option; - eremoteio : int option; - enomedium : int option; - emediumtype : int option; - enokey : int option; - ekeyexpired : int option; - ekeyrevoked : int option; - ekeyrejected : int option; - erfkill : int option; - ehwpoison : int option; - epwroff : int option; - edeverr : int option; - ebadexec : int option; - ebadarch : int option; - eshlibvers : int option; - ebadmacho : int option; - enopolicy : int option; - eqfull : int option; - edoofus : int option; - enotcapable : int option; - ecapmode : int option; - eproclim : int option; - ebadrpc : int option; - erpcmismatch : int option; - eprogunavail : int option; - eprogmismatch : int option; - eprocunavail : int option; - eftype : int option; - eauth : int option; - eneedauth : int option; - enoattr : int option; - enostr : int option; - enodata : int option; - etime : int option; - enosr : int option; + e2big : Signed.sint option; + eacces : Signed.sint option; + eaddrinuse : Signed.sint option; + eaddrnotavail : Signed.sint option; + eafnosupport : Signed.sint option; + eagain : Signed.sint option; + ealready : Signed.sint option; + ebadf : Signed.sint option; + ebadmsg : Signed.sint option; + ebusy : Signed.sint option; + ecanceled : Signed.sint option; + echild : Signed.sint option; + econnaborted : Signed.sint option; + econnrefused : Signed.sint option; + econnreset : Signed.sint option; + edeadlk : Signed.sint option; + edestaddrreq : Signed.sint option; + edom : Signed.sint option; + edquot : Signed.sint option; + eexist : Signed.sint option; + efault : Signed.sint option; + efbig : Signed.sint option; + ehostdown : Signed.sint option; + ehostunreach : Signed.sint option; + eidrm : Signed.sint option; + eilseq : Signed.sint option; + einprogress : Signed.sint option; + eintr : Signed.sint option; + einval : Signed.sint option; + eio : Signed.sint option; + eisconn : Signed.sint option; + eisdir : Signed.sint option; + eloop : Signed.sint option; + emfile : Signed.sint option; + emlink : Signed.sint option; + emsgsize : Signed.sint option; + emultihop : Signed.sint option; + enametoolong : Signed.sint option; + enetdown : Signed.sint option; + enetreset : Signed.sint option; + enetunreach : Signed.sint option; + enfile : Signed.sint option; + enobufs : Signed.sint option; + enodev : Signed.sint option; + enoent : Signed.sint option; + enoexec : Signed.sint option; + enolck : Signed.sint option; + enolink : Signed.sint option; + enomem : Signed.sint option; + enomsg : Signed.sint option; + enoprotoopt : Signed.sint option; + enospc : Signed.sint option; + enosys : Signed.sint option; + enotblk : Signed.sint option; + enotconn : Signed.sint option; + enotdir : Signed.sint option; + enotempty : Signed.sint option; + enotrecoverable : Signed.sint option; + enotsock : Signed.sint option; + enotsup : Signed.sint option; + enotty : Signed.sint option; + enxio : Signed.sint option; + eopnotsupp : Signed.sint option; + eoverflow : Signed.sint option; + eownerdead : Signed.sint option; + eperm : Signed.sint option; + epfnosupport : Signed.sint option; + epipe : Signed.sint option; + eproto : Signed.sint option; + eprotonosupport : Signed.sint option; + eprototype : Signed.sint option; + erange : Signed.sint option; + eremote : Signed.sint option; + erofs : Signed.sint option; + eshutdown : Signed.sint option; + esocktnosupport : Signed.sint option; + espipe : Signed.sint option; + esrch : Signed.sint option; + estale : Signed.sint option; + etimedout : Signed.sint option; + etoomanyrefs : Signed.sint option; + etxtbsy : Signed.sint option; + eusers : Signed.sint option; + ewouldblock : Signed.sint option; + exdev : Signed.sint option; + echrng : Signed.sint option; + el2nsync : Signed.sint option; + el3hlt : Signed.sint option; + el3rst : Signed.sint option; + elnrng : Signed.sint option; + eunatch : Signed.sint option; + enocsi : Signed.sint option; + el2hlt : Signed.sint option; + ebade : Signed.sint option; + ebadr : Signed.sint option; + exfull : Signed.sint option; + enoano : Signed.sint option; + ebadrqc : Signed.sint option; + ebadslt : Signed.sint option; + ebfont : Signed.sint option; + enonet : Signed.sint option; + enopkg : Signed.sint option; + eadv : Signed.sint option; + esrmnt : Signed.sint option; + ecomm : Signed.sint option; + edotdot : Signed.sint option; + enotuniq : Signed.sint option; + ebadfd : Signed.sint option; + eremchg : Signed.sint option; + elibacc : Signed.sint option; + elibbad : Signed.sint option; + elibscn : Signed.sint option; + elibmax : Signed.sint option; + elibexec : Signed.sint option; + erestart : Signed.sint option; + estrpipe : Signed.sint option; + euclean : Signed.sint option; + enotnam : Signed.sint option; + enavail : Signed.sint option; + eisnam : Signed.sint option; + eremoteio : Signed.sint option; + enomedium : Signed.sint option; + emediumtype : Signed.sint option; + enokey : Signed.sint option; + ekeyexpired : Signed.sint option; + ekeyrevoked : Signed.sint option; + ekeyrejected : Signed.sint option; + erfkill : Signed.sint option; + ehwpoison : Signed.sint option; + epwroff : Signed.sint option; + edeverr : Signed.sint option; + ebadexec : Signed.sint option; + ebadarch : Signed.sint option; + eshlibvers : Signed.sint option; + ebadmacho : Signed.sint option; + enopolicy : Signed.sint option; + eqfull : Signed.sint option; + edoofus : Signed.sint option; + enotcapable : Signed.sint option; + ecapmode : Signed.sint option; + eproclim : Signed.sint option; + ebadrpc : Signed.sint option; + erpcmismatch : Signed.sint option; + eprogunavail : Signed.sint option; + eprogmismatch : Signed.sint option; + eprocunavail : Signed.sint option; + eftype : Signed.sint option; + eauth : Signed.sint option; + eneedauth : Signed.sint option; + enoattr : Signed.sint option; + enostr : Signed.sint option; + enodata : Signed.sint option; + etime : Signed.sint option; + enosr : Signed.sint option; } module Host : sig @@ -348,13 +348,13 @@ module Host : sig end -val to_code : host:Host.t -> t -> int option +val to_code : host:Host.t -> t -> Signed.sint option -val of_code : host:Host.t -> int -> t list +val of_code : host:Host.t -> Signed.sint -> t list val to_string : t -> string -val iter_defns : defns -> (int -> t -> unit) -> (t -> unit) -> unit +val iter_defns : defns -> (Signed.sint -> t -> unit) -> (t -> unit) -> unit val string_of_defns : defns -> string diff --git a/lib_gen/unix_errno_bindings.ml b/lib_gen/unix_errno_bindings.ml index 5ce7908..4f50d1d 100644 --- a/lib_gen/unix_errno_bindings.ml +++ b/lib_gen/unix_errno_bindings.ml @@ -21,85 +21,85 @@ module C(F: Cstubs.FOREIGN) = struct let reset_errno = F.(foreign "unix_errno_reset" (void @-> returning void)) - let get_errno = F.(foreign "unix_errno_get" (void @-> returning int)) + let get_errno = F.(foreign "unix_errno_get" (void @-> returning sint)) (* OS X and FreeBSD don't have these *) - let echrng = F.(foreign "unix_errno_echrng" (void @-> returning int)) - let el2nsync = F.(foreign "unix_errno_el2nsync" (void @-> returning int)) - let el3hlt = F.(foreign "unix_errno_el3hlt" (void @-> returning int)) - let el3rst = F.(foreign "unix_errno_el3rst" (void @-> returning int)) - let elnrng = F.(foreign "unix_errno_elnrng" (void @-> returning int)) - let eunatch = F.(foreign "unix_errno_eunatch" (void @-> returning int)) - let enocsi = F.(foreign "unix_errno_enocsi" (void @-> returning int)) - let el2hlt = F.(foreign "unix_errno_el2hlt" (void @-> returning int)) - let ebade = F.(foreign "unix_errno_ebade" (void @-> returning int)) - let ebadr = F.(foreign "unix_errno_ebadr" (void @-> returning int)) - let exfull = F.(foreign "unix_errno_exfull" (void @-> returning int)) - let enoano = F.(foreign "unix_errno_enoano" (void @-> returning int)) - let ebadrqc = F.(foreign "unix_errno_ebadrqc" (void @-> returning int)) - let ebadslt = F.(foreign "unix_errno_ebadslt" (void @-> returning int)) - let ebfont = F.(foreign "unix_errno_ebfont" (void @-> returning int)) - let enonet = F.(foreign "unix_errno_enonet" (void @-> returning int)) - let enopkg = F.(foreign "unix_errno_enopkg" (void @-> returning int)) - let eadv = F.(foreign "unix_errno_eadv" (void @-> returning int)) - let esrmnt = F.(foreign "unix_errno_esrmnt" (void @-> returning int)) - let ecomm = F.(foreign "unix_errno_ecomm" (void @-> returning int)) - let edotdot = F.(foreign "unix_errno_edotdot" (void @-> returning int)) - let enotuniq = F.(foreign "unix_errno_enotuniq" (void @-> returning int)) - let ebadfd = F.(foreign "unix_errno_ebadfd" (void @-> returning int)) - let eremchg = F.(foreign "unix_errno_eremchg" (void @-> returning int)) - let elibacc = F.(foreign "unix_errno_elibacc" (void @-> returning int)) - let elibbad = F.(foreign "unix_errno_elibbad" (void @-> returning int)) - let elibscn = F.(foreign "unix_errno_elibscn" (void @-> returning int)) - let elibmax = F.(foreign "unix_errno_elibmax" (void @-> returning int)) - let elibexec = F.(foreign "unix_errno_elibexec" (void @-> returning int)) - let erestart = F.(foreign "unix_errno_erestart" (void @-> returning int)) - let estrpipe = F.(foreign "unix_errno_estrpipe" (void @-> returning int)) - let euclean = F.(foreign "unix_errno_euclean" (void @-> returning int)) - let enotnam = F.(foreign "unix_errno_enotnam" (void @-> returning int)) - let enavail = F.(foreign "unix_errno_enavail" (void @-> returning int)) - let eisnam = F.(foreign "unix_errno_eisnam" (void @-> returning int)) - let eremoteio = F.(foreign "unix_errno_eremoteio" (void @-> returning int)) - let enomedium = F.(foreign "unix_errno_enomedium" (void @-> returning int)) - let emediumtype = F.(foreign "unix_errno_emediumtype" (void @-> returning int)) - let enokey = F.(foreign "unix_errno_enokey" (void @-> returning int)) - let ekeyexpired = F.(foreign "unix_errno_ekeyexpired" (void @-> returning int)) - let ekeyrevoked = F.(foreign "unix_errno_ekeyrevoked" (void @-> returning int)) - let ekeyrejected = F.(foreign "unix_errno_ekeyrejected" (void @-> returning int)) - let erfkill = F.(foreign "unix_errno_erfkill" (void @-> returning int)) - let ehwpoison = F.(foreign "unix_errno_ehwpoison" (void @-> returning int)) + let echrng = F.(foreign "unix_errno_echrng" (void @-> returning sint)) + let el2nsync = F.(foreign "unix_errno_el2nsync" (void @-> returning sint)) + let el3hlt = F.(foreign "unix_errno_el3hlt" (void @-> returning sint)) + let el3rst = F.(foreign "unix_errno_el3rst" (void @-> returning sint)) + let elnrng = F.(foreign "unix_errno_elnrng" (void @-> returning sint)) + let eunatch = F.(foreign "unix_errno_eunatch" (void @-> returning sint)) + let enocsi = F.(foreign "unix_errno_enocsi" (void @-> returning sint)) + let el2hlt = F.(foreign "unix_errno_el2hlt" (void @-> returning sint)) + let ebade = F.(foreign "unix_errno_ebade" (void @-> returning sint)) + let ebadr = F.(foreign "unix_errno_ebadr" (void @-> returning sint)) + let exfull = F.(foreign "unix_errno_exfull" (void @-> returning sint)) + let enoano = F.(foreign "unix_errno_enoano" (void @-> returning sint)) + let ebadrqc = F.(foreign "unix_errno_ebadrqc" (void @-> returning sint)) + let ebadslt = F.(foreign "unix_errno_ebadslt" (void @-> returning sint)) + let ebfont = F.(foreign "unix_errno_ebfont" (void @-> returning sint)) + let enonet = F.(foreign "unix_errno_enonet" (void @-> returning sint)) + let enopkg = F.(foreign "unix_errno_enopkg" (void @-> returning sint)) + let eadv = F.(foreign "unix_errno_eadv" (void @-> returning sint)) + let esrmnt = F.(foreign "unix_errno_esrmnt" (void @-> returning sint)) + let ecomm = F.(foreign "unix_errno_ecomm" (void @-> returning sint)) + let edotdot = F.(foreign "unix_errno_edotdot" (void @-> returning sint)) + let enotuniq = F.(foreign "unix_errno_enotuniq" (void @-> returning sint)) + let ebadfd = F.(foreign "unix_errno_ebadfd" (void @-> returning sint)) + let eremchg = F.(foreign "unix_errno_eremchg" (void @-> returning sint)) + let elibacc = F.(foreign "unix_errno_elibacc" (void @-> returning sint)) + let elibbad = F.(foreign "unix_errno_elibbad" (void @-> returning sint)) + let elibscn = F.(foreign "unix_errno_elibscn" (void @-> returning sint)) + let elibmax = F.(foreign "unix_errno_elibmax" (void @-> returning sint)) + let elibexec = F.(foreign "unix_errno_elibexec" (void @-> returning sint)) + let erestart = F.(foreign "unix_errno_erestart" (void @-> returning sint)) + let estrpipe = F.(foreign "unix_errno_estrpipe" (void @-> returning sint)) + let euclean = F.(foreign "unix_errno_euclean" (void @-> returning sint)) + let enotnam = F.(foreign "unix_errno_enotnam" (void @-> returning sint)) + let enavail = F.(foreign "unix_errno_enavail" (void @-> returning sint)) + let eisnam = F.(foreign "unix_errno_eisnam" (void @-> returning sint)) + let eremoteio = F.(foreign "unix_errno_eremoteio" (void @-> returning sint)) + let enomedium = F.(foreign "unix_errno_enomedium" (void @-> returning sint)) + let emediumtype = F.(foreign "unix_errno_emediumtype" (void @-> returning sint)) + let enokey = F.(foreign "unix_errno_enokey" (void @-> returning sint)) + let ekeyexpired = F.(foreign "unix_errno_ekeyexpired" (void @-> returning sint)) + let ekeyrevoked = F.(foreign "unix_errno_ekeyrevoked" (void @-> returning sint)) + let ekeyrejected = F.(foreign "unix_errno_ekeyrejected" (void @-> returning sint)) + let erfkill = F.(foreign "unix_errno_erfkill" (void @-> returning sint)) + let ehwpoison = F.(foreign "unix_errno_ehwpoison" (void @-> returning sint)) (* Linux and FreeBSD don't have these *) - let epwroff = F.(foreign "unix_errno_epwroff" (void @-> returning int)) - let edeverr = F.(foreign "unix_errno_edeverr" (void @-> returning int)) - let ebadexec = F.(foreign "unix_errno_ebadexec" (void @-> returning int)) - let ebadarch = F.(foreign "unix_errno_ebadarch" (void @-> returning int)) - let eshlibvers = F.(foreign "unix_errno_eshlibvers" (void @-> returning int)) - let ebadmacho = F.(foreign "unix_errno_ebadmacho" (void @-> returning int)) - let enopolicy = F.(foreign "unix_errno_enopolicy" (void @-> returning int)) - let eqfull = F.(foreign "unix_errno_eqfull" (void @-> returning int)) + let epwroff = F.(foreign "unix_errno_epwroff" (void @-> returning sint)) + let edeverr = F.(foreign "unix_errno_edeverr" (void @-> returning sint)) + let ebadexec = F.(foreign "unix_errno_ebadexec" (void @-> returning sint)) + let ebadarch = F.(foreign "unix_errno_ebadarch" (void @-> returning sint)) + let eshlibvers = F.(foreign "unix_errno_eshlibvers" (void @-> returning sint)) + let ebadmacho = F.(foreign "unix_errno_ebadmacho" (void @-> returning sint)) + let enopolicy = F.(foreign "unix_errno_enopolicy" (void @-> returning sint)) + let eqfull = F.(foreign "unix_errno_eqfull" (void @-> returning sint)) (* Linux and OS X don't have these *) - let edoofus = F.(foreign "unix_errno_edoofus" (void @-> returning int)) - let enotcapable = F.(foreign "unix_errno_enotcapable" (void @-> returning int)) - let ecapmode = F.(foreign "unix_errno_ecapmode" (void @-> returning int)) + let edoofus = F.(foreign "unix_errno_edoofus" (void @-> returning sint)) + let enotcapable = F.(foreign "unix_errno_enotcapable" (void @-> returning sint)) + let ecapmode = F.(foreign "unix_errno_ecapmode" (void @-> returning sint)) (* Linux doesn't have these *) - let eproclim = F.(foreign "unix_errno_eproclim" (void @-> returning int)) - let ebadrpc = F.(foreign "unix_errno_ebadrpc" (void @-> returning int)) - let erpcmismatch = F.(foreign "unix_errno_erpcmismatch" (void @-> returning int)) - let eprogunavail = F.(foreign "unix_errno_eprogunavail" (void @-> returning int)) - let eprogmismatch = F.(foreign "unix_errno_eprogmismatch" (void @-> returning int)) - let eprocunavail = F.(foreign "unix_errno_eprocunavail" (void @-> returning int)) - let eftype = F.(foreign "unix_errno_eftype" (void @-> returning int)) - let eauth = F.(foreign "unix_errno_eauth" (void @-> returning int)) - let eneedauth = F.(foreign "unix_errno_eneedauth" (void @-> returning int)) - let enoattr = F.(foreign "unix_errno_enoattr" (void @-> returning int)) + let eproclim = F.(foreign "unix_errno_eproclim" (void @-> returning sint)) + let ebadrpc = F.(foreign "unix_errno_ebadrpc" (void @-> returning sint)) + let erpcmismatch = F.(foreign "unix_errno_erpcmismatch" (void @-> returning sint)) + let eprogunavail = F.(foreign "unix_errno_eprogunavail" (void @-> returning sint)) + let eprogmismatch = F.(foreign "unix_errno_eprogmismatch" (void @-> returning sint)) + let eprocunavail = F.(foreign "unix_errno_eprocunavail" (void @-> returning sint)) + let eftype = F.(foreign "unix_errno_eftype" (void @-> returning sint)) + let eauth = F.(foreign "unix_errno_eauth" (void @-> returning sint)) + let eneedauth = F.(foreign "unix_errno_eneedauth" (void @-> returning sint)) + let enoattr = F.(foreign "unix_errno_enoattr" (void @-> returning sint)) (* FreeBSD doesn't have these *) - let enostr = F.(foreign "unix_errno_enostr" (void @-> returning int)) - let enodata = F.(foreign "unix_errno_enodata" (void @-> returning int)) - let etime = F.(foreign "unix_errno_etime" (void @-> returning int)) - let enosr = F.(foreign "unix_errno_enosr" (void @-> returning int)) + let enostr = F.(foreign "unix_errno_enostr" (void @-> returning sint)) + let enodata = F.(foreign "unix_errno_enodata" (void @-> returning sint)) + let etime = F.(foreign "unix_errno_etime" (void @-> returning sint)) + let enosr = F.(foreign "unix_errno_enosr" (void @-> returning sint)) end diff --git a/lib_gen/unix_errno_types.ml b/lib_gen/unix_errno_types.ml index f057444..6a88179 100644 --- a/lib_gen/unix_errno_types.ml +++ b/lib_gen/unix_errno_types.ml @@ -17,90 +17,90 @@ module C(F: Cstubs.Types.TYPE) = struct - let e2big = F.(constant "E2BIG" int) - let eacces = F.(constant "EACCES" int) - let eaddrinuse = F.(constant "EADDRINUSE" int) - let eaddrnotavail = F.(constant "EADDRNOTAVAIL" int) - let eafnosupport = F.(constant "EAFNOSUPPORT" int) - let eagain = F.(constant "EAGAIN" int) - let ealready = F.(constant "EALREADY" int) - let ebadf = F.(constant "EBADF" int) - let ebadmsg = F.(constant "EBADMSG" int) - let ebusy = F.(constant "EBUSY" int) - let ecanceled = F.(constant "ECANCELED" int) - let echild = F.(constant "ECHILD" int) - let econnaborted = F.(constant "ECONNABORTED" int) - let econnrefused = F.(constant "ECONNREFUSED" int) - let econnreset = F.(constant "ECONNRESET" int) - let edeadlk = F.(constant "EDEADLK" int) - let edestaddrreq = F.(constant "EDESTADDRREQ" int) - let edom = F.(constant "EDOM" int) - let edquot = F.(constant "EDQUOT" int) - let eexist = F.(constant "EEXIST" int) - let efault = F.(constant "EFAULT" int) - let efbig = F.(constant "EFBIG" int) - let ehostdown = F.(constant "EHOSTDOWN" int) - let ehostunreach = F.(constant "EHOSTUNREACH" int) - let eidrm = F.(constant "EIDRM" int) - let eilseq = F.(constant "EILSEQ" int) - let einprogress = F.(constant "EINPROGRESS" int) - let eintr = F.(constant "EINTR" int) - let einval = F.(constant "EINVAL" int) - let eio = F.(constant "EIO" int) - let eisconn = F.(constant "EISCONN" int) - let eisdir = F.(constant "EISDIR" int) - let eloop = F.(constant "ELOOP" int) - let emfile = F.(constant "EMFILE" int) - let emlink = F.(constant "EMLINK" int) - let emsgsize = F.(constant "EMSGSIZE" int) - let emultihop = F.(constant "EMULTIHOP" int) - let enametoolong = F.(constant "ENAMETOOLONG" int) - let enetdown = F.(constant "ENETDOWN" int) - let enetreset = F.(constant "ENETRESET" int) - let enetunreach = F.(constant "ENETUNREACH" int) - let enfile = F.(constant "ENFILE" int) - let enobufs = F.(constant "ENOBUFS" int) - let enodev = F.(constant "ENODEV" int) - let enoent = F.(constant "ENOENT" int) - let enoexec = F.(constant "ENOEXEC" int) - let enolck = F.(constant "ENOLCK" int) - let enolink = F.(constant "ENOLINK" int) - let enomem = F.(constant "ENOMEM" int) - let enomsg = F.(constant "ENOMSG" int) - let enoprotoopt = F.(constant "ENOPROTOOPT" int) - let enospc = F.(constant "ENOSPC" int) - let enosys = F.(constant "ENOSYS" int) - let enotblk = F.(constant "ENOTBLK" int) - let enotconn = F.(constant "ENOTCONN" int) - let enotdir = F.(constant "ENOTDIR" int) - let enotempty = F.(constant "ENOTEMPTY" int) - let enotrecoverable = F.(constant "ENOTRECOVERABLE" int) - let enotsock = F.(constant "ENOTSOCK" int) - let enotsup = F.(constant "ENOTSUP" int) - let enotty = F.(constant "ENOTTY" int) - let enxio = F.(constant "ENXIO" int) - let eopnotsupp = F.(constant "EOPNOTSUPP" int) - let eoverflow = F.(constant "EOVERFLOW" int) - let eownerdead = F.(constant "EOWNERDEAD" int) - let eperm = F.(constant "EPERM" int) - let epfnosupport = F.(constant "EPFNOSUPPORT" int) - let epipe = F.(constant "EPIPE" int) - let eproto = F.(constant "EPROTO" int) - let eprotonosupport = F.(constant "EPROTONOSUPPORT" int) - let eprototype = F.(constant "EPROTOTYPE" int) - let erange = F.(constant "ERANGE" int) - let eremote = F.(constant "EREMOTE" int) - let erofs = F.(constant "EROFS" int) - let eshutdown = F.(constant "ESHUTDOWN" int) - let esocktnosupport = F.(constant "ESOCKTNOSUPPORT" int) - let espipe = F.(constant "ESPIPE" int) - let esrch = F.(constant "ESRCH" int) - let estale = F.(constant "ESTALE" int) - let etimedout = F.(constant "ETIMEDOUT" int) - let etoomanyrefs = F.(constant "ETOOMANYREFS" int) - let etxtbsy = F.(constant "ETXTBSY" int) - let eusers = F.(constant "EUSERS" int) - let ewouldblock = F.(constant "EWOULDBLOCK" int) - let exdev = F.(constant "EXDEV" int) + let e2big = F.(constant "E2BIG" sint) + let eacces = F.(constant "EACCES" sint) + let eaddrinuse = F.(constant "EADDRINUSE" sint) + let eaddrnotavail = F.(constant "EADDRNOTAVAIL" sint) + let eafnosupport = F.(constant "EAFNOSUPPORT" sint) + let eagain = F.(constant "EAGAIN" sint) + let ealready = F.(constant "EALREADY" sint) + let ebadf = F.(constant "EBADF" sint) + let ebadmsg = F.(constant "EBADMSG" sint) + let ebusy = F.(constant "EBUSY" sint) + let ecanceled = F.(constant "ECANCELED" sint) + let echild = F.(constant "ECHILD" sint) + let econnaborted = F.(constant "ECONNABORTED" sint) + let econnrefused = F.(constant "ECONNREFUSED" sint) + let econnreset = F.(constant "ECONNRESET" sint) + let edeadlk = F.(constant "EDEADLK" sint) + let edestaddrreq = F.(constant "EDESTADDRREQ" sint) + let edom = F.(constant "EDOM" sint) + let edquot = F.(constant "EDQUOT" sint) + let eexist = F.(constant "EEXIST" sint) + let efault = F.(constant "EFAULT" sint) + let efbig = F.(constant "EFBIG" sint) + let ehostdown = F.(constant "EHOSTDOWN" sint) + let ehostunreach = F.(constant "EHOSTUNREACH" sint) + let eidrm = F.(constant "EIDRM" sint) + let eilseq = F.(constant "EILSEQ" sint) + let einprogress = F.(constant "EINPROGRESS" sint) + let eintr = F.(constant "EINTR" sint) + let einval = F.(constant "EINVAL" sint) + let eio = F.(constant "EIO" sint) + let eisconn = F.(constant "EISCONN" sint) + let eisdir = F.(constant "EISDIR" sint) + let eloop = F.(constant "ELOOP" sint) + let emfile = F.(constant "EMFILE" sint) + let emlink = F.(constant "EMLINK" sint) + let emsgsize = F.(constant "EMSGSIZE" sint) + let emultihop = F.(constant "EMULTIHOP" sint) + let enametoolong = F.(constant "ENAMETOOLONG" sint) + let enetdown = F.(constant "ENETDOWN" sint) + let enetreset = F.(constant "ENETRESET" sint) + let enetunreach = F.(constant "ENETUNREACH" sint) + let enfile = F.(constant "ENFILE" sint) + let enobufs = F.(constant "ENOBUFS" sint) + let enodev = F.(constant "ENODEV" sint) + let enoent = F.(constant "ENOENT" sint) + let enoexec = F.(constant "ENOEXEC" sint) + let enolck = F.(constant "ENOLCK" sint) + let enolink = F.(constant "ENOLINK" sint) + let enomem = F.(constant "ENOMEM" sint) + let enomsg = F.(constant "ENOMSG" sint) + let enoprotoopt = F.(constant "ENOPROTOOPT" sint) + let enospc = F.(constant "ENOSPC" sint) + let enosys = F.(constant "ENOSYS" sint) + let enotblk = F.(constant "ENOTBLK" sint) + let enotconn = F.(constant "ENOTCONN" sint) + let enotdir = F.(constant "ENOTDIR" sint) + let enotempty = F.(constant "ENOTEMPTY" sint) + let enotrecoverable = F.(constant "ENOTRECOVERABLE" sint) + let enotsock = F.(constant "ENOTSOCK" sint) + let enotsup = F.(constant "ENOTSUP" sint) + let enotty = F.(constant "ENOTTY" sint) + let enxio = F.(constant "ENXIO" sint) + let eopnotsupp = F.(constant "EOPNOTSUPP" sint) + let eoverflow = F.(constant "EOVERFLOW" sint) + let eownerdead = F.(constant "EOWNERDEAD" sint) + let eperm = F.(constant "EPERM" sint) + let epfnosupport = F.(constant "EPFNOSUPPORT" sint) + let epipe = F.(constant "EPIPE" sint) + let eproto = F.(constant "EPROTO" sint) + let eprotonosupport = F.(constant "EPROTONOSUPPORT" sint) + let eprototype = F.(constant "EPROTOTYPE" sint) + let erange = F.(constant "ERANGE" sint) + let eremote = F.(constant "EREMOTE" sint) + let erofs = F.(constant "EROFS" sint) + let eshutdown = F.(constant "ESHUTDOWN" sint) + let esocktnosupport = F.(constant "ESOCKTNOSUPPORT" sint) + let espipe = F.(constant "ESPIPE" sint) + let esrch = F.(constant "ESRCH" sint) + let estale = F.(constant "ESTALE" sint) + let etimedout = F.(constant "ETIMEDOUT" sint) + let etoomanyrefs = F.(constant "ETOOMANYREFS" sint) + let etxtbsy = F.(constant "ETXTBSY" sint) + let eusers = F.(constant "EUSERS" sint) + let ewouldblock = F.(constant "EWOULDBLOCK" sint) + let exdev = F.(constant "EXDEV" sint) end diff --git a/src/_tags b/src/_tags index 09234c0..9da016e 100644 --- a/src/_tags +++ b/src/_tags @@ -1 +1,2 @@ : package(ctypes.stubs), use_errno_stubs +<*.*>: package(ctypes) \ No newline at end of file diff --git a/src/errno_srcgen.ml b/src/errno_srcgen.ml index d2c0433..bdec5ee 100644 --- a/src/errno_srcgen.ml +++ b/src/errno_srcgen.ml @@ -34,7 +34,7 @@ open Printf let field_of_errno errno = String.lowercase (Errno.to_string errno) let () = Errno.iter_defns defns - (fun i errno -> printf " %s = Some %d;\n" (field_of_errno errno) i) + (fun i errno -> printf " %s = Some (Signed.SInt.of_int64 %LdL);\n" (field_of_errno errno) (Signed.SInt.to_int64 i)) (fun errno -> printf " %s = None;\n" (field_of_errno errno)) let () = print_endline "})\n" diff --git a/unix/errno_unix.ml b/unix/errno_unix.ml index 3ff96cb..ac53d37 100644 --- a/unix/errno_unix.ml +++ b/unix/errno_unix.ml @@ -20,7 +20,7 @@ module C = Unix_errno_bindings.C(Unix_errno_generated) let host = let option i = Some i in - let platform = function -1 -> None | i -> Some i in + let platform i = Signed.SInt.(if i = minus_one then None else Some i) in let defns = Errno.(Type.({ e2big = option e2big; eacces = option eacces; @@ -180,7 +180,7 @@ let host = Errno.Host.of_defns defns let optional_unknown ~host errno = match Errno.to_code ~host errno with - | Some i -> Some (Unix.EUNKNOWNERR i) + | Some i -> Some (Unix.EUNKNOWNERR (Signed.SInt.to_int i)) | None -> None let to_unix ?(host=host) = Errno.(function @@ -338,7 +338,7 @@ let to_unix ?(host=host) = Errno.(function | ENODATA -> optional_unknown ~host ENODATA | ETIME -> optional_unknown ~host ETIME | ENOSR -> optional_unknown ~host ENOSR - | EUNKNOWNERR x -> Some (Unix.EUNKNOWNERR x) + | EUNKNOWNERR x -> Some (Unix.EUNKNOWNERR (Signed.SInt.to_int x)) ) let of_unix ?(host=host) = Unix.(function @@ -410,7 +410,7 @@ let of_unix ?(host=host) = Unix.(function | ETOOMANYREFS -> [Errno.ETOOMANYREFS] | EWOULDBLOCK -> [Errno.EWOULDBLOCK] | EXDEV -> [Errno.EXDEV] - | EUNKNOWNERR x -> Errno.of_code ~host x + | EUNKNOWNERR x -> Errno.of_code ~host (Signed.SInt.of_int x) ) let get_errno = C.get_errno diff --git a/unix/errno_unix.mli b/unix/errno_unix.mli index 3e516ab..f3876b9 100644 --- a/unix/errno_unix.mli +++ b/unix/errno_unix.mli @@ -29,7 +29,7 @@ val of_unix : ?host:Errno.Host.t -> Unix.error -> Errno.t list corresponding to the {!Unix.error}, [error]. If [host] is not supplied, {!host} will be used. *) -val get_errno : unit -> int +val get_errno : unit -> Signed.sint (** [get_errno ()] returns the current value of the C [errno] thread-local variable. *) @@ -37,7 +37,7 @@ val reset_errno : unit -> unit (** [reset_errno ()] sets the current value of the C [errno] thread-local variable to 0. *) -val raise_errno : ?call:string -> ?label:string -> int -> 'a +val raise_errno : ?call:string -> ?label:string -> Signed.sint -> 'a (** [raise_errno ?call ?label errno] raises {!Errno.Error} after converting [errno] to the appropriate variants via {!host}. [call] and [label] default to the empty string. *) From a53277b56d74377d70228ca13f7ce9c9af9b91d3 Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Tue, 26 Jul 2016 11:57:34 +0100 Subject: [PATCH 2/2] Prepare for 0.5.0 release. --- CHANGES | 3 +++ META | 2 +- opam | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index aae4678..6157d36 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +0.5.0 (2016-07-26): +* Switch errno from int to Ctypes.sint + 0.4.2 (2016-06-01): * Add support for ctypes 0.6.0 diff --git a/META b/META index dcb569a..835d840 100644 --- a/META +++ b/META @@ -1,4 +1,4 @@ -version = "0.4.2" +version = "0.5.0" description = "Unix errno types, maps, and support" requires = "result bytes" archive(byte) = "errno_.cma" diff --git a/opam b/opam index 94ff65a..ca3cc5f 100644 --- a/opam +++ b/opam @@ -1,6 +1,6 @@ opam-version: "1.2" name: "unix-errno" -version: "0.4.2" +version: "0.5.0" maintainer: "sheets@alum.mit.edu" authors: "David Sheets" homepage: "https://github.com/dsheets/ocaml-unix-errno" @@ -30,6 +30,6 @@ depopts: [ "ctypes" ] conflicts: [ - "ctypes" {< "0.4.0"} + "ctypes" {< "0.7.0"} ] available: [ ocaml-version >= "4.01.0" ]