diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-08-09 21:08:08 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-08-09 21:08:08 +0300 |
commit | e9786ddcfcdeae8e6230f9c4b8f51445a3ff1d9c (patch) | |
tree | bb5663b30dfb97a7958cdd250063aa10c2141821 | |
parent | 63e02ea9ae9921a45d36ab631fa31593cf149370 (diff) | |
download | egawk-e9786ddcfcdeae8e6230f9c4b8f51445a3ff1d9c.tar.gz egawk-e9786ddcfcdeae8e6230f9c4b8f51445a3ff1d9c.tar.bz2 egawk-e9786ddcfcdeae8e6230f9c4b8f51445a3ff1d9c.zip |
Improve checking for MPFR in API at dl_load time.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gawkapi.h | 14 |
2 files changed, 14 insertions, 6 deletions
@@ -1,5 +1,11 @@ 2017-08-09 Arnold D. Robbins <arnold@skeeve.com> + * gawkapi.h (check_mpfr_versions): Define differently based on if + MPFR version macro is defined. Enhance body to use do/while(0). + (dl_load): Call check_mpfr_versions unconditionally. + +2017-08-09 Arnold D. Robbins <arnold@skeeve.com> + * main.c (usage): Add URL for Bug reporting info to the help message. Unrelated: @@ -1115,6 +1115,8 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ exit(1); \ } \ \ + check_mpfr_version(extension); \ +\ /* load functions */ \ for (i = 0, j = sizeof(func_table) / sizeof(func_table[0]); i < j; i++) { \ if (func_table[i].name == NULL) \ @@ -1139,11 +1141,8 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ return (errors == 0); \ } -/* - * If you are using extended-precision calculations in your library, please - * call this macro from your init_func. - */ -#define check_mpfr_version(extension) { \ +#if defined __GNU_MP_VERSION && defined MPFR_VERSION_MAJOR +#define check_mpfr_version(extension) do { \ if (api->gmp_major_version != __GNU_MP_VERSION \ || api->gmp_minor_version < __GNU_MP_VERSION_MINOR) { \ fprintf(stderr, #extension ": GMP version mismatch with gawk!\n"); \ @@ -1160,7 +1159,10 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ api->mpfr_major_version, api->mpfr_minor_version); \ exit(1); \ } \ -} +} while (0) +#else +#define check_mpfr_version(extension) /* nothing */ +#endif #endif /* GAWK */ |