summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-09-23 13:14:12 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-09-23 13:14:12 +0000
commitce878305c42212fbff9b69eb7b92da8b8d4b68c4 (patch)
treeac810a089f2950be26dd6ae5f58a8bbac1f9ef0b /examples
parent89bdb3b26dba94deda69100672186ae1c99c6218 (diff)
downloadmpfr-ce878305c42212fbff9b69eb7b92da8b8d4b68c4.tar.gz
[examples/version.c]
* Code simplification: support for MPFR versions less than 3.0 had already been dropped with the use of MPFR_RNDN. * For MPFR patches, output "[none]" when there are no patches. * Output mpfr_ptr size. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10885 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'examples')
-rw-r--r--examples/version.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/examples/version.c b/examples/version.c
index 3459027b1..705a95da7 100644
--- a/examples/version.c
+++ b/examples/version.c
@@ -49,6 +49,12 @@ static void failure_test (void)
mpfr_clear (x);
}
+static void patches (void)
+{
+ const char *p = mpfr_get_patches ();
+ printf ("MPFR patches: %s\n", p[0] ? p : "[none]");
+}
+
int main (void)
{
unsigned long c;
@@ -66,20 +72,19 @@ int main (void)
mpfr_get_version (), MPFR_VERSION_STRING, MPFR_VERSION_MAJOR,
MPFR_VERSION_MINOR, MPFR_VERSION_PATCHLEVEL);
-#if MPFR_VERSION_MAJOR >= 3
printf ("MPFR features: TLS = %s, decimal = %s",
mpfr_buildopt_tls_p () ? "yes" : "no",
mpfr_buildopt_decimal_p () ? "yes" : "no");
-# if MPFR_VERSION_MAJOR > 3 || MPFR_VERSION_MINOR >= 1
+#if MPFR_VERSION_MAJOR > 3 || MPFR_VERSION_MINOR >= 1
printf (", GMP internals = %s\nMPFR tuning: %s",
mpfr_buildopt_gmpinternals_p () ? "yes" : "no",
mpfr_buildopt_tune_case ());
-# endif
+#endif /* 3.1 */
printf ("\n");
-#endif
- printf ("MPFR patches: %s\n\n", mpfr_get_patches ());
+ patches ();
+ printf ("\n");
#ifdef __GMP_CC
printf ("__GMP_CC = \"%s\"\n", __GMP_CC);
#endif
@@ -105,10 +110,8 @@ int main (void)
printf ("\n");
printf ("sizeof(mpfr_prec_t) = %d (%s type)\n", (int) sizeof(mpfr_prec_t),
SIGNED_STR((mpfr_prec_t) -1));
-#if MPFR_VERSION_MAJOR >= 3
printf ("sizeof(mpfr_exp_t) = %d (%s type)\n", (int) sizeof(mpfr_exp_t),
SIGNED_STR((mpfr_exp_t) -1));
-#endif
#ifdef _MPFR_PREC_FORMAT
printf ("_MPFR_PREC_FORMAT = %d\n", (int) _MPFR_PREC_FORMAT);
#endif
@@ -122,7 +125,7 @@ int main (void)
printf ("_MPFR_EXP_FORMAT = %d\n", (int) _MPFR_EXP_FORMAT);
#endif
printf ("sizeof(mpfr_t) = %d\n", (int) sizeof(mpfr_t));
-
+ printf ("sizeof(mpfr_ptr) = %d\n", (int) sizeof(mpfr_ptr));
failure_test ();
return 0;