The unified diff between revisions [2dcd0c66..] and [1c4b364b..] is displayed below. It can also be downloaded as a raw diff.
#
#
# patch "generate_constants.c"
# from [b6cf716b5e5975b08f74d323207b705a88363654]
# to [384efd466d85c2a0349c500ca93f4fac5484f2b4]
#
# patch "src/gmp-binding.ads"
# from [80967bb37f8fc64cb40743c9bfb53d74d8b3c9cb]
# to [1036cd0477e568a3112fd683232f5c730f670847]
#
============================================================
--- generate_constants.c b6cf716b5e5975b08f74d323207b705a88363654
+++ generate_constants.c 384efd466d85c2a0349c500ca93f4fac5484f2b4
@@ -24,12 +24,14 @@ int main (int argc, char* argv[])
{
const __mpz_struct z;
+ if (argc != 1)
+ error (EXIT_FAILURE, 0, "no argument expected.");
if (sizeof(z._mp_alloc) != sizeof(int) ||
sizeof(z._mp_size) != sizeof(int) ||
sizeof(z._mp_d) != sizeof(mp_limb_t*) ||
sizeof(z._mp_alloc)+sizeof(z._mp_size)+sizeof(z._mp_d) != sizeof(mpz_t))
{
- error (1, 0, "\n\
+ error (EXIT_FAILURE, 0, "\n\
An incompatible change of mpz_t has been detected in gmp.h.\n\
Please report this to the Ada binding author.\n");
}
@@ -40,27 +42,27 @@ Please report this to the Ada binding au
printf ("package GMP.Constants is\n");
printf (" pragma Pure;\n");
printf (" Gmp_Version : constant String := \"%s\";\n", gmp_version);
- printf (" Mp_Bits_Per_Limb : constant := %i;\n", mp_bits_per_limb);
- printf (" Gnu_Mp_Version : constant := %i;\n", __GNU_MP_VERSION);
- printf (" Gnu_Mp_Version_Minor : constant := %i;\n", __GNU_MP_VERSION_MINOR);
- printf (" Gnu_Mp_Version_Patchlevel : constant := %i;\n", __GNU_MP_VERSION_PATCHLEVEL);
- printf (" Mp_Exp_T_Size : constant := %i;\n", 8*sizeof(mp_exp_t));
- printf (" Mp_Size_T_Size : constant := %i;\n", 8*sizeof(mp_size_t));
- printf (" Mp_Limb_T_Size : constant := %i;\n", 8*sizeof(mp_limb_t));
- printf (" Mpz_Alloc_Start : constant := %i;\n", (char*)&z._mp_alloc - (char*)&z);
- printf (" Mpz_Alloc_Length : constant := %i;\n", 8 * sizeof (z._mp_alloc));
- printf (" Mpz_Size_Start : constant := %i;\n", (char*)&z._mp_size - (char*)&z);
- printf (" Mpz_Size_Length : constant := %i;\n", 8 * sizeof (z._mp_size));
- printf (" Mpz_D_Start : constant := %i;\n", (char*)&z._mp_d - (char*)&z);
- printf (" Mpz_D_Length : constant := %i;\n", 8 * sizeof (z._mp_d));
- printf (" Sizeof_Mpq_T : constant := %i;\n", sizeof(mpq_t));
- printf (" Sizeof_Mpf_T : constant := %i;\n", sizeof(mpf_t));
- printf (" Sizeof_Gmp_Randstate_T : constant := %i;\n", sizeof(gmp_randstate_t));
- printf (" Sizeof_Mpfr_T : constant := %i;\n", sizeof(mpfr_t));
- printf (" Mp_Prec_T_Size : constant := %i;\n", 8*sizeof(mp_prec_t));
+ printf (" Mp_Bits_Per_Limb : constant := %u;\n", mp_bits_per_limb);
+ printf (" Gnu_Mp_Version : constant := %u;\n", __GNU_MP_VERSION);
+ printf (" Gnu_Mp_Version_Minor : constant := %u;\n", __GNU_MP_VERSION_MINOR);
+ printf (" Gnu_Mp_Version_Patchlevel : constant := %u;\n", __GNU_MP_VERSION_PATCHLEVEL);
+ printf (" Mp_Exp_T_Size : constant := %lu;\n", 8*sizeof(mp_exp_t));
+ printf (" Mp_Size_T_Size : constant := %lu;\n", 8*sizeof(mp_size_t));
+ printf (" Mp_Limb_T_Size : constant := %lu;\n", 8*sizeof(mp_limb_t));
+ printf (" Mpz_Alloc_Start : constant := %li;\n", (char*)&z._mp_alloc - (char*)&z);
+ printf (" Mpz_Alloc_Length : constant := %lu;\n", 8 * sizeof (z._mp_alloc));
+ printf (" Mpz_Size_Start : constant := %li;\n", (char*)&z._mp_size - (char*)&z);
+ printf (" Mpz_Size_Length : constant := %lu;\n", 8 * sizeof (z._mp_size));
+ printf (" Mpz_D_Start : constant := %li;\n", (char*)&z._mp_d - (char*)&z);
+ printf (" Mpz_D_Length : constant := %lu;\n", 8 * sizeof (z._mp_d));
+ printf (" Sizeof_Mpq_T : constant := %lu;\n", sizeof(mpq_t));
+ printf (" Sizeof_Mpf_T : constant := %lu;\n", sizeof(mpf_t));
+ printf (" Sizeof_Gmp_Randstate_T : constant := %lu;\n", sizeof(gmp_randstate_t));
+ printf (" Sizeof_Mpfr_T : constant := %lu;\n", sizeof(mpfr_t));
+ printf (" Mp_Prec_T_Size : constant := %lu;\n", 8*sizeof(mp_prec_t));
printf (" Mpfr_Prec_Min : constant := %i;\n", MPFR_PREC_MIN);
printf (" Mpfr_Prec_Max : constant := %lu;\n", MPFR_PREC_MAX);
- printf (" Mp_Rnd_T_Size : constant := %i;\n", 8*sizeof(mp_rnd_t));
+ printf (" Mp_Rnd_T_Size : constant := %lu;\n", 8*sizeof(mp_rnd_t));
printf (" Gmp_Rndn : constant := %i;\n", GMP_RNDN);
printf (" Gmp_Rndz : constant := %i;\n", GMP_RNDZ);
printf (" Gmp_Rndu : constant := %i;\n", GMP_RNDU);
============================================================
--- src/gmp-binding.ads 80967bb37f8fc64cb40743c9bfb53d74d8b3c9cb
+++ src/gmp-binding.ads 1036cd0477e568a3112fd683232f5c730f670847
@@ -1837,11 +1837,13 @@ package GMP.Binding is
type Mp_Prec_T is range GMP.Constants.Mpfr_Prec_Min .. GMP.Constants.Mpfr_Prec_Max;
for Mp_Prec_T'Size use GMP.Constants.Mp_Prec_T_Size;
- type Mp_Rnd_T is mod 2 ** GMP.Constants.Mp_Rnd_T_Size;
- Gmp_Rndn : constant Mp_Rnd_T := GMP.Constants.Gmp_Rndn;
- Gmp_Rndz : constant Mp_Rnd_T := GMP.Constants.Gmp_Rndz;
- Gmp_Rndu : constant Mp_Rnd_T := GMP.Constants.Gmp_Rndu;
- Gmp_Rndd : constant Mp_Rnd_T := GMP.Constants.Gmp_Rndd;
+ type Mp_Rnd_T is (Gmp_Rndn, Gmp_Rndz, Gmp_Rndu, Gmp_Rndd);
+ for Mp_Rnd_T use
+ (Gmp_Rndn => GMP.Constants.Gmp_Rndn,
+ Gmp_Rndz => GMP.Constants.Gmp_Rndz,
+ Gmp_Rndu => GMP.Constants.Gmp_Rndu,
+ Gmp_Rndd => GMP.Constants.Gmp_Rndd);
+ for Mp_Rnd_T'Size use GMP.Constants.Mp_Rnd_T_Size;
procedure Mpfr_Init2 (X : out Mpfr_T;
Prec : in Mp_Prec_T);