diff options
author | Jonsba <jonasb@tranquille.ch> | 2016-06-28 04:26:18 +0200 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2016-06-28 04:26:18 +0200 |
commit | 2ea6a59083a16e3093116101bc574fce623ff344 (patch) | |
tree | 79c94a95baf39f690cbd56f513d695c981ce6e1d /src/grt/grt-options.adb | |
parent | dc8680d3b002df5dbc2c92e86b133803a9e68a39 (diff) | |
download | ghdl-2ea6a59083a16e3093116101bc574fce623ff344.tar.gz ghdl-2ea6a59083a16e3093116101bc574fce623ff344.tar.bz2 ghdl-2ea6a59083a16e3093116101bc574fce623ff344.zip |
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
Diffstat (limited to 'src/grt/grt-options.adb')
-rw-r--r-- | src/grt/grt-options.adb | 5 |
1 files changed, 5 insertions, 0 deletions
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); |