summaryrefslogtreecommitdiff
path: root/tests/tversion.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-01-20 15:08:45 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-01-20 15:08:45 +0000
commitf10eb82bbb59289ac94f924eb770257b88967215 (patch)
tree3e8f441e1dbb510813694e83eafe66cfb95a0641 /tests/tversion.c
parent6441056b58912a757b93a89f688ee533beccaf63 (diff)
downloadmpfr-f10eb82bbb59289ac94f924eb770257b88967215.tar.gz
tests/tversion.c: be more tolerant when checking whether gmp.h version
and libgmp version are the same (in case patch level is 0). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5879 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tversion.c')
-rw-r--r--tests/tversion.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/tversion.c b/tests/tversion.c
index 24ec41f0a..554793c44 100644
--- a/tests/tversion.c
+++ b/tests/tversion.c
@@ -50,11 +50,17 @@ main (void)
}
#endif
- if (__GNU_MP_VERSION_PATCHLEVEL != 0)
- sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR,
- __GNU_MP_VERSION_PATCHLEVEL);
- else
- sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR);
+ sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR,
+ __GNU_MP_VERSION_PATCHLEVEL);
+ if (strcmp (buffer, gmp_version) == 0)
+ return 0;
+ if (__GNU_MP_VERSION_PATCHLEVEL == 0)
+ {
+ sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR);
+ if (strcmp (buffer, gmp_version) == 0)
+ return 0;
+ }
+
/* In some cases, it may be acceptable to have different versions for
the header and the library, in particular when shared libraries are
used (e.g., after a bug-fix upgrade of the library). Versioning takes
@@ -63,12 +69,11 @@ main (void)
uses GMP internals, which may lead to incompatibilities even though
GMP's public interface has not changed (the following warning is
useful in that case too). */
- if (strcmp (buffer, gmp_version) != 0)
- printf ("The versions of gmp.h (%s) and libgmp (%s) do not seem to "
- "match.\nThis may lead to errors, in particular with MPFR. "
- "If some tests fail,\nplease check that first. As we are not "
- "sure, we do not regard this as\nan error.\n",
- buffer, gmp_version);
+ printf ("WARNING! The versions of gmp.h (%s) and libgmp (%s) do not "
+ "match.\nThis may lead to errors, in particular with MPFR. "
+ "If some tests fail,\nplease check that first. As we are not "
+ "sure, we do not regard this as\nan error.\n",
+ buffer, gmp_version);
return 0;
}