gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, master, updated. gawk-4.1.0-4734-g0f12de29


From: Arnold Robbins
Subject: [SCM] gawk branch, master, updated. gawk-4.1.0-4734-g0f12de29
Date: Wed, 1 Jun 2022 11:29:24 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  0f12de2956197c2b889bf780e44b2724381f4317 (commit)
      from  826e12f58a88c02959d196d1df569790d3c3ad06 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0f12de2956197c2b889bf780e44b2724381f4317

commit 0f12de2956197c2b889bf780e44b2724381f4317
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Wed Jun 1 18:28:59 2022 +0300

    Fix rwarray extension to compile if don't have MPFR.

diff --git a/extension/ChangeLog b/extension/ChangeLog
index 2049201b..c6d0fae5 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,9 @@
+2022-06-01         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * rwarray.c: Add ifdefs for MPFR in a few places that were
+       missing. The extension wouldn't compile if HAVE_MPFR was
+       not defined.
+
 2022-04-05         Arnold D. Robbins     <arnold@skeeve.com>
 
        * testext.c (test_array_param): Init new_array to avoid
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 7422be9f..92e8ddd2 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -78,10 +78,14 @@ static awk_bool_t write_elem(FILE *fp, awk_element_t 
*element);
 static awk_bool_t write_value(FILE *fp, awk_value_t *val);
 static awk_bool_t write_number(FILE *fp, awk_value_t *val);
 
+#ifdef HAVE_MPFR
 typedef union {
        mpz_t mpz_val;
        mpfr_t mpfr_val;
 } value_storage;
+#else
+typedef int value_storage;     // should not be used
+#endif /* HAVE_MPFR */
 
 typedef awk_array_t (*array_handle_t)(awk_value_t *);
 static awk_bool_t read_array(FILE *fp, awk_array_t array);
@@ -421,12 +425,14 @@ free_value(awk_value_t *v)
                case AWK_NUMBER_TYPE_DOUBLE:
                        /* no memory allocated */
                        break;
+#ifdef HAVE_MPFR
                case AWK_NUMBER_TYPE_MPZ:
                        mpz_clear(v->num_ptr);
                        break;
                case AWK_NUMBER_TYPE_MPFR:
                        mpfr_clear(v->num_ptr);
                        break;
+#endif /* HAVE_MPFR */
                default:
                        warning(ext_id, _("cannot free number with unknown type 
%d"), v->num_type);
                        break;

-----------------------------------------------------------------------

Summary of changes:
 extension/ChangeLog | 6 ++++++
 extension/rwarray.c | 6 ++++++
 2 files changed, 12 insertions(+)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]