summaryrefslogtreecommitdiff
path: root/translate/grt
diff options
context:
space:
mode:
Diffstat (limited to 'translate/grt')
-rw-r--r--translate/grt/grt-cbinding.c6
-rw-r--r--translate/grt/grt-stats.adb8
2 files changed, 9 insertions, 5 deletions
diff --git a/translate/grt/grt-cbinding.c b/translate/grt/grt-cbinding.c
index 8885e12..1b75fcf 100644
--- a/translate/grt/grt-cbinding.c
+++ b/translate/grt/grt-cbinding.c
@@ -43,6 +43,12 @@ __ghdl_fprintf_g (FILE *stream, double val)
fprintf (stream, "%g", val);
}
+void
+__ghdl_fprintf_clock (FILE *stream, int a, int b)
+{
+ fprintf (stream, "%3d.%03d", a, b);
+}
+
#if 1
void
__gnat_last_chance_handler (void)
diff --git a/translate/grt/grt-stats.adb b/translate/grt/grt-stats.adb
index 13a939a..cf5674e 100644
--- a/translate/grt/grt-stats.adb
+++ b/translate/grt/grt-stats.adb
@@ -71,10 +71,8 @@ package body Grt.Stats is
procedure Put (Stream : FILEs; Val : Clock_T)
is
- Fmt : constant String := "%3d.%03d" & Character'Val (0);
-
- procedure fprintf (Stream : FILEs; Fmt : Address; A, B : Clock_T);
- pragma Import (C, fprintf);
+ procedure Fprintf_Clock (Stream : FILEs; A, B : Clock_T);
+ pragma Import (C, Fprintf_Clock, "__ghdl_fprintf_clock");
Sec : Clock_T;
Ms : Clock_T;
@@ -84,7 +82,7 @@ package body Grt.Stats is
-- Avoid overflow.
Ms := ((Val mod One_Second) * 1000) / One_Second;
- fprintf (Stream, Fmt'Address, Sec, Ms);
+ Fprintf_Clock (Stream, Sec, Ms);
end Put;
procedure Put (Stream : FILEs; T : Time_Stats) is