From 2ea6a59083a16e3093116101bc574fce623ff344 Mon Sep 17 00:00:00 2001 From: Jonsba Date: Tue, 28 Jun 2016 04:26:18 +0200 Subject: Jonsba/master (#100) * Add a --unbuffered option for simulation. It disables buffering for stdout, stderr and files opened in write or append mode (TEXTIO). Fixes #87 * Some simplifications made on the previous commit. Documentation added for --unbuffered in Simulation_and_runtime.rst. * Some more simplifications on unbuffered writes support for TEXTIO * Fix a style issue failure reported by Travis-CI --- src/grt/grt-options.adb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/grt/grt-options.adb') diff --git a/src/grt/grt-options.adb b/src/grt/grt-options.adb index 81fa962f0..943ff9626 100644 --- a/src/grt/grt-options.adb +++ b/src/grt/grt-options.adb @@ -25,6 +25,7 @@ with Interfaces; use Interfaces; with Grt.Strings; use Grt.Strings; with Grt.Errors; use Grt.Errors; +with Grt.Stdio; use Grt.Stdio; with Grt.Astdio; with Grt.Hooks; @@ -477,6 +478,10 @@ package body Grt.Options is end if; Last_Generic_Override := Over; end; + elsif Option = "--unbuffered" then + Unbuffered_Writes := True; + setbuf (stdout, NULL_voids); + setbuf (stderr, NULL_voids); elsif not Grt.Hooks.Call_Option_Hooks (Option) then Error_C ("unknown option '"); Error_C (Option); -- cgit v1.2.3