aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-errors.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-08-30 05:36:10 +0200
committerTristan Gingold <tgingold@free.fr>2017-08-30 05:36:10 +0200
commitf8d8c61c81150294cf06f10684a8e4180426890b (patch)
treeebeeced7c62ae0042f185d232bf2d0117ba9f1a1 /src/grt/grt-errors.adb
parentaf74db16db371518111858e0ab123a52276059bc (diff)
downloadghdl-f8d8c61c81150294cf06f10684a8e4180426890b.tar.gz
ghdl-f8d8c61c81150294cf06f10684a8e4180426890b.tar.bz2
ghdl-f8d8c61c81150294cf06f10684a8e4180426890b.zip
Write assert and report messages to stdout
Fix #394
Diffstat (limited to 'src/grt/grt-errors.adb')
-rw-r--r--src/grt/grt-errors.adb20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/grt/grt-errors.adb b/src/grt/grt-errors.adb
index 9a48de48e..28ee85963 100644
--- a/src/grt/grt-errors.adb
+++ b/src/grt/grt-errors.adb
@@ -29,6 +29,14 @@ with Grt.Hooks; use Grt.Hooks;
with Grt.Backtraces;
package body Grt.Errors is
+ -- Output stream to send error messages
+ Out_Stream : FILEs;
+
+ procedure Set_Out_Stream (Stream : Grt.Stdio.FILEs) is
+ begin
+ Out_Stream := Stream;
+ end Set_Out_Stream;
+
-- Called in case of premature exit.
-- CODE is 0 for success, 1 for failure.
procedure Ghdl_Exit (Code : Integer);
@@ -74,27 +82,27 @@ package body Grt.Errors is
procedure Put_Err (Str : String) is
begin
- Put (stderr, Str);
+ Put (Out_Stream, Str);
end Put_Err;
procedure Put_Err (C : Character) is
begin
- Put (stderr, C);
+ Put (Out_Stream, C);
end Put_Err;
procedure Put_Err (Str : Ghdl_C_String) is
begin
- Put (stderr, Str);
+ Put (Out_Stream, Str);
end Put_Err;
procedure Put_Err (N : Integer) is
begin
- Put_I32 (stderr, Ghdl_I32 (N));
+ Put_I32 (Out_Stream, Ghdl_I32 (N));
end Put_Err;
procedure Newline_Err is
begin
- New_Line (stderr);
+ New_Line (Out_Stream);
end Newline_Err;
-- procedure Put_Err (Str : Ghdl_Str_Len_Type)
@@ -133,7 +141,7 @@ package body Grt.Errors is
procedure Report_Now_C is
begin
- Put_Time (stderr, Grt.Types.Current_Time);
+ Put_Time (Out_Stream, Grt.Types.Current_Time);
end Report_Now_C;
procedure Report_E (Str : String) is