diff options
-rw-r--r-- | otherlibs/threads/pervasives.ml | 8 | ||||
-rw-r--r-- | otherlibs/threads/threadUnix.ml | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/otherlibs/threads/pervasives.ml b/otherlibs/threads/pervasives.ml index 4b61dcb54..c2834ac98 100644 --- a/otherlibs/threads/pervasives.ml +++ b/otherlibs/threads/pervasives.ml @@ -5,7 +5,7 @@ (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) -(* Automatique. Distributed only by permission. *) +(* en Automatique. Distributed only by permission. *) (* *) (***********************************************************************) @@ -107,7 +107,9 @@ external frexp : float -> float * int = "frexp_float" external ldexp : float -> int -> float = "ldexp_float" external modf : float -> float * float = "modf_float" "modf" external float : int -> float = "%floatofint" +external float_of_int : int -> float = "%floatofint" external truncate : float -> int = "%intoffloat" +external int_of_float : float -> int = "%intoffloat" (* String operations -- more in module String *) @@ -135,6 +137,10 @@ external format_float: string -> float -> string = "format_float" let string_of_bool b = if b then "true" else "false" +let bool_of_string = function + | "true" -> true + | "false" -> false + | _ -> invalid_arg "string_of_bool" let string_of_int n = format_int "%d" n diff --git a/otherlibs/threads/threadUnix.ml b/otherlibs/threads/threadUnix.ml index e22a26a63..a20bdf876 100644 --- a/otherlibs/threads/threadUnix.ml +++ b/otherlibs/threads/threadUnix.ml @@ -178,6 +178,6 @@ let establish_server server_fun sockaddr = close_in inchan; close_out outchan; exit 0 - | id -> close s; waitpid [] id (* Reclaim the son *); () + | id -> close s; let _ = waitpid [] id (* Reclaim the son *) in () done |