summaryrefslogtreecommitdiff
path: root/translate
diff options
context:
space:
mode:
authorgingold2009-12-30 13:28:25 +0000
committergingold2009-12-30 13:28:25 +0000
commit8cca0b24e2c19eedecffdeec89a8a2898da1e362 (patch)
tree25dbfdd7b64a942a311239e5e664aa027e0b0263 /translate
parentf529e7bae13bfb58075c495552a9cbfdd0f10f88 (diff)
downloadghdl-8cca0b24e2c19eedecffdeec89a8a2898da1e362.tar.gz
ghdl-8cca0b24e2c19eedecffdeec89a8a2898da1e362.tar.bz2
ghdl-8cca0b24e2c19eedecffdeec89a8a2898da1e362.zip
Fix fprintf call on x86-64.
From Thomas Sailer.
Diffstat (limited to 'translate')
-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