Add MPIR_VERSION macros.

This commit is contained in:
wbhart 2008-07-23 02:26:25 +00:00
parent 6b1b3f9a15
commit 13f01913b2
5 changed files with 42 additions and 4 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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

View File

@ -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__ */

View File

@ -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;