aboutsummaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorjohn haque <j.eh@mchsi.com>2012-02-16 15:44:26 -0600
committerjohn haque <j.eh@mchsi.com>2012-02-16 15:44:26 -0600
commit0221eb79f43f4ef5c8d74759679a501607936d19 (patch)
tree05bad5469dfeba414838280cb86332b8fa853be7 /msg.c
parent06a6f16495e2a3d0cb664fc473107d3cdbe6f11e (diff)
downloadegawk-0221eb79f43f4ef5c8d74759679a501607936d19.tar.gz
egawk-0221eb79f43f4ef5c8d74759679a501607936d19.tar.bz2
egawk-0221eb79f43f4ef5c8d74759679a501607936d19.zip
New interpreter routine for MPFR.
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/msg.c b/msg.c
index 10f3837a..6f662959 100644
--- a/msg.c
+++ b/msg.c
@@ -62,6 +62,20 @@ err(const char *s, const char *emsg, va_list argp)
(void) fprintf(stderr, "%d: ", sourceline);
}
+
+#ifdef HAVE_MPFR
+ if (FNR_node && (FNR_node->var_value->flags & MPFN) != 0) {
+ mpfr_update_var(FNR_node);
+ mpfr_get_z(mpzval, FNR_node->var_value->mpfr_numbr, MPFR_RNDZ);
+ if (mpz_sgn(mpzval) > 0) {
+ file = FILENAME_node->var_value->stptr;
+ (void) putc('(', stderr);
+ if (file)
+ (void) fprintf(stderr, "FILENAME=%s ", file);
+ (void) mpfr_fprintf(stderr, "FNR=%Zd) ", mpzval);
+ }
+ } else
+#endif
if (FNR > 0) {
file = FILENAME_node->var_value->stptr;
(void) putc('(', stderr);
@@ -69,6 +83,7 @@ err(const char *s, const char *emsg, va_list argp)
(void) fprintf(stderr, "FILENAME=%s ", file);
(void) fprintf(stderr, "FNR=%ld) ", FNR);
}
+
(void) fprintf(stderr, "%s", s);
vfprintf(stderr, emsg, argp);
(void) fprintf(stderr, "\n");