From 13f01913b236195a3eb883401edc1a9b52d1f76e Mon Sep 17 00:00:00 2001 From: wbhart Date: Wed, 23 Jul 2008 02:26:25 +0000 Subject: [PATCH] Add MPIR_VERSION macros. --- acinclude.m4 | 13 +++++++++++++ configure.in | 2 +- doc/gmp.texi | 18 +++++++++++++++++- gmp-h.in | 8 ++++++++ version.c | 5 +++-- 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 9e5553d8..8fb2c12b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -152,6 +152,19 @@ ifelse(m4_eval(GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp-h.in) > 0),1, [.GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp-h.in)])]) +dnl MPIR_VERSION +dnl ----------- +dnl The mpir version number, extracted from the #defines in gmp-h.in at +dnl autoconf time. Two digits like 3.0 if patchlevel <= 0, or three digits +dnl like 3.0.1 if patchlevel > 0. + +define(MPIR_VERSION, +[GMP_HEADER_GETVAL(__MPIR_VERSION,gmp-h.in)[]dnl +.GMP_HEADER_GETVAL(__MPIR_VERSION_MINOR,gmp-h.in)[]dnl +ifelse(m4_eval(GMP_HEADER_GETVAL(__MPIR_VERSION_PATCHLEVEL,gmp-h.in) > 0),1, +[.GMP_HEADER_GETVAL(__MPIR_VERSION_PATCHLEVEL,gmp-h.in)])]) + + dnl GMP_SUBST_CHECK_FUNCS(func,...) dnl ------------------------------ dnl Setup an AC_SUBST of HAVE_FUNC_01 for each argument. diff --git a/configure.in b/configure.in index 066ac8d2..deb5f43e 100644 --- a/configure.in +++ b/configure.in @@ -28,7 +28,7 @@ AH_TOP(/*GMP_COPYRIGHT*/) AC_REVISION($Revision: 1.11 $) AC_PREREQ(2.59) -AC_INIT(GNU MP, GMP_VERSION, gmp-bugs@swox.com, gmp) +AC_INIT(MPIR, MPIR_VERSION, http://groups.google.co.uk/group/mpir-devel/, mpir) AC_CONFIG_SRCDIR(gmp-impl.h) m4_pattern_forbid([^[ \t]*GMP_]) m4_pattern_allow(GMP_LDFLAGS) diff --git a/doc/gmp.texi b/doc/gmp.texi index 5835f611..89402486 100644 --- a/doc/gmp.texi +++ b/doc/gmp.texi @@ -2196,6 +2196,17 @@ The number of bits per limb. @defmacx __GNU_MP_VERSION_PATCHLEVEL @cindex Version number @cindex MPIR version number +The major and minor GMP version, and patch level, respectively, as integers. +For GMP i.j, these numbers will be i, j, and 0, respectively. +For GMP i.j.k, these numbers will be i, j, and k, respectively. +These numbers represent the version of GMP fully supported by this version of MPIR. +@end defmac + +@defmac __MPIR_VERSION +@defmacx __MPIR_VERSION_MINOR +@defmacx __MPIR_VERSION_PATCHLEVEL +@cindex Version number +@cindex MPIR version number The major and minor MPIR version, and patch level, respectively, as integers. For MPIR i.j, these numbers will be i, j, and 0, respectively. For MPIR i.j.k, these numbers will be i, j, and k, respectively. @@ -2203,11 +2214,16 @@ For MPIR i.j.k, these numbers will be i, j, and k, respectively. @deftypevr {Global Constant} {const char * const} gmp_version @findex gmp_version +The GNU MP version number, as a null-terminated string, in the form ``i.j'' or +``i.j.k''. +@end deftypevr + +@deftypevr {Global Constant} {const char * const} mpir_version +@findex mpir_version The MPIR version number, as a null-terminated string, in the form ``i.j'' or ``i.j.k''. This release is @nicode{"@value{VERSION}"}. @end deftypevr - @node Compatibility with older versions, Demonstration Programs, Useful Macros and Constants, MPIR Basics @section Compatibility with older versions @cindex Compatibility with older versions diff --git a/gmp-h.in b/gmp-h.in index 9b61e176..f4ff213c 100644 --- a/gmp-h.in +++ b/gmp-h.in @@ -549,6 +549,9 @@ __GMP_DECLSPEC extern int gmp_errno; #define gmp_version __gmp_version __GMP_DECLSPEC extern __gmp_const char * __gmp_const gmp_version; +#define mpir_version __mpir_version +__GMP_DECLSPEC extern __gmp_const char * __gmp_const mpir_version; + /**************** Random number routines. ****************/ @@ -2184,6 +2187,11 @@ enum #define __GNU_MP_VERSION 4 #define __GNU_MP_VERSION_MINOR 2 #define __GNU_MP_VERSION_PATCHLEVEL 1 +#define GMP_VERSION "4.2.1" + +#define __MPIR_VERSION 0 +#define __MPIR_VERSION_MINOR 9 +#define __MPIR_VERSION_PATCHLEVEL 0 #define __GMP_H__ #endif /* __GMP_H__ */ diff --git a/version.c b/version.c index e5772ec5..2f985e66 100644 --- a/version.c +++ b/version.c @@ -1,4 +1,4 @@ -/* gmp_version -- version number compiled into the library. +/* gmp_version and mpir_version -- version numbers compiled into the library. Copyright 1996, 1999, 2000, 2001 Free Software Foundation, Inc. @@ -22,4 +22,5 @@ MA 02110-1301, USA. */ #include "gmp.h" #include "gmp-impl.h" -const char * const gmp_version = VERSION; +const char * const gmp_version = GMP_VERSION; +const char * const mpir_version = VERSION;