Next: Extension API Informational Variables, Previous: Extension Versioning, Up: Extension API Variables [Contents][Index]
The API also includes information about the versions of GMP and MPFR
with which the running gawk was compiled (if any).
They are included in the API struct as read-only
constant integers:
api->gmp_major_versionThe major version of the GMP library used to compile gawk.
api->gmp_minor_versionThe minor version of the GMP library used to compile gawk.
api->mpfr_major_versionThe major version of the MPFR library used to compile gawk.
api->mpfr_minor_versionThe minor version of the MPFR library used to compile gawk.
These fields are set to zero if gawk was compiled without
MPFR support.
You can check if the versions of MPFR and GMP that you are using match those
of gawk with the following macro:
check_mpfr_version(extension)The extension is the extension id passed to all the other macros
and functions defined in gawkapi.h.  If you have not included
the <mpfr.h> header file, then this macro will be defined to do nothing.
If you have included that file, then this macro compares the MPFR
and GMP major and minor versions against those of the library you are
compiling against.  If your libraries are newer than gawk’s, it
produces a fatal error message.
The dl_load_func() macro (see section Boilerplate Code)
calls check_mpfr_version().