From 08642139dc3edf2caf94e7f246c15644daca16ad Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 21 Apr 2011 16:12:31 +0000 Subject: Win32: if we make coqide console-free, then stderr/stdout/sdtin shouldn't be used This is an adaptation of commit r13751 of branch 8.3 Even if coqide.exe keeps its console by default for the moment, we try to allow turning it off (for instance via the mkwinapp tool) : for that we need to be cautious about the use of functions like prerr_endline. Since stderr doesn't exists in this settings, such functions trigger a Sys_error "bad file descriptor". This patch protects many access to std** by a (try ... with _ ->()). Nota: with camlp5 < 6.02.1, Print Grammar was also generating such a Sys_error. TODO: we should try to figure a way of displaying messages (both debug and early/late error message). A log file ? A popup ? diplay in the response buffer ? git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14040 85f007b7-540e-0410-9357-904b9bb8a0f7 --- ide/ideutils.mli | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ide/ideutils.mli') diff --git a/ide/ideutils.mli b/ide/ideutils.mli index f15cd120c..fe8936877 100644 --- a/ide/ideutils.mli +++ b/ide/ideutils.mli @@ -30,8 +30,12 @@ val is_char_start : char -> bool val lib_ide_file : string -> string val my_stat : string -> Unix.stats option +(** safe version of Pervasives.prerr_endline + (avoid exception in win32 without console) *) +val safe_prerr_endline : string -> unit +(** debug printing *) val prerr_endline : string -> unit -val prerr_string : string -> unit + val print_id : 'a -> unit val revert_timer : GMain.Timeout.id option ref -- cgit v1.2.3