]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(main): Avoid using gmp_fprintf, to stay compatible with gmp-3.1.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 4 Nov 2008 19:59:29 +0000 (20:59 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 4 Nov 2008 19:59:29 +0000 (20:59 +0100)
Rev: nettle/examples/next-prime.c:1.3

examples/next-prime.c

index 714638286ff8b222a317be60f51efaadf7f7054f..584835f4cdb02c77219b4a6911bb6110e00fffa0 100644 (file)
@@ -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;
 }