From a41627ef1d304a6346a83d0dc9e051f2e39d5fc2 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 12 Feb 2011 00:45:00 +0000 Subject: [PATCH] return time as an int64, not as a float. --- packages/PLStream/pl-files.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/PLStream/pl-files.c b/packages/PLStream/pl-files.c index c4e798aeb..f6597e3c2 100755 --- a/packages/PLStream/pl-files.c +++ b/packages/PLStream/pl-files.c @@ -349,7 +349,13 @@ MarkExecutable(const char *name) int unifyTime(term_t t, time_t time) -{ return PL_unify_float(t, (double)time); +{ +#if __YAP_PROLOG__ + /* maintain compatibility with old Prolog systems, and avoid losing precision unnecessarily */ + return PL_unify_int64(t, (int64_t)time); +#else + return PL_unify_float(t, (double)time); +#endif }