From 998ec60d697b20a6298ec805927abaa8d80e2d68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Tue, 4 Nov 2008 20:59:29 +0100
Subject: [PATCH] (main): Avoid using gmp_fprintf, to stay compatible with
 gmp-3.1.

Rev: nettle/examples/next-prime.c:1.3
---
 examples/next-prime.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/examples/next-prime.c b/examples/next-prime.c
index 71463828..584835f4 100644
--- a/examples/next-prime.c
+++ b/examples/next-prime.c
@@ -145,9 +145,11 @@ main(int argc, char **argv)
       mpz_init(d);
       mpz_sub(d, p, n);
 
-      gmp_fprintf(stderr, "bit size: %lu, diff: %Zd, total time: %.3g s\n",
-		  mpz_sizeinbase(p, 2), d,
-		  (double)(end - start) / CLOCKS_PER_SEC);
+      /* Avoid using gmp_fprintf, to stay compatible with gmp-3.1. */
+      fprintf(stderr, "bit size: %lu, diff: ", (unsigned long) mpz_sizeinbase(p, 2));
+      mpz_out_str(stderr, 10, d);
+      fprintf(stderr, ", total time: %.3g s\n",
+	      (double)(end - start) / CLOCKS_PER_SEC);
     }
   return EXIT_SUCCESS;
 }
-- 
GitLab