summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1996-11-07 11:00:46 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1996-11-07 11:00:46 +0000
commit08921d6b738bcbfa78731b91b47f3d1f44f0775f (patch)
treea31f5952f77744e99c9c4bfb6b1a08ca5cd29741
parenta8ce67aeb9e22ff3ba3b32ec983d3c3809994c9d (diff)
Utilisation de Sys.os_type. Nettoyages.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1172 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--otherlibs/graph/graphics.ml11
-rw-r--r--tools/ocamldep.mll4
2 files changed, 6 insertions, 9 deletions
diff --git a/otherlibs/graph/graphics.ml b/otherlibs/graph/graphics.ml
index 9778cb308..c8c04fe13 100644
--- a/otherlibs/graph/graphics.ml
+++ b/otherlibs/graph/graphics.ml
@@ -18,8 +18,6 @@ exception Graphic_failure of string
external register_graphic_failure: exn -> unit = "gr_register_graphic_failure"
let _ = register_graphic_failure(Graphic_failure "")
-let os_type = (Sys.get_config ()).Sys.os_type;;
-
external raw_open_graph: string -> unit = "gr_open_graph"
external raw_close_graph: unit -> unit = "gr_close_graph"
external sigio_signal: unit -> int = "gr_sigio_signal"
@@ -28,18 +26,17 @@ external sigio_handler: int -> unit = "gr_sigio_handler"
let unix_open_graph arg =
Sys.signal (sigio_signal()) (Sys.Signal_handle sigio_handler);
raw_open_graph arg
-;;
+
let unix_close_graph () =
Sys.signal (sigio_signal()) Sys.Signal_ignore;
raw_close_graph ()
-;;
+
let (open_graph, close_graph) =
- match os_type with
+ match Sys.os_type with
| "Unix" -> (unix_open_graph, unix_close_graph)
| "Win32" -> (raw_open_graph, raw_close_graph)
| "MacOS" -> (raw_open_graph, raw_close_graph)
- | _ -> failwith ("Graphics: unknown OS type: " ^ os_type)
-;;
+ | _ -> invalid_arg ("Graphics: unknown OS type: " ^ Sys.os_type)
external clear_graph : unit -> unit = "gr_clear_graph"
external size_x : unit -> int = "gr_size_x"
diff --git a/tools/ocamldep.mll b/tools/ocamldep.mll
index 9cd10ba62..c3e031da4 100644
--- a/tools/ocamldep.mll
+++ b/tools/ocamldep.mll
@@ -121,10 +121,10 @@ let find_dependency modname (byt_deps, opt_deps) =
(byt_deps, opt_deps)
let (depends_on, escaped_eol) =
- match (Sys.get_config ()).Sys.os_type with
+ match Sys.os_type with
| "Unix" | "Win32" -> (": ", "\\\n ")
| "MacOS" -> ("\196 ", "\182\n ")
- | x -> failwith ("Ocamldep: unknown system type" ^ x)
+ | x -> Misc.fatal_error ("Ocamldep: unknown system type" ^ x)
;;
let print_dependencies target_file deps =