mini-gmp

Niels Möller nisse at lysator.liu.se
Thu Jan 16 08:15:41 UTC 2014


Vincent Lefevre <vincent at vinc17.net> writes:

> On 2014-01-15 23:23:28 +0100, Niels Möller wrote:

(about GMP_NUMB_BITS)

>> If you need a preprocessor constant, I think it has to be defined (or
>> redefined) outside of mini-gmp.h.
>
> Yes, we need a preprocessor constant. But we could have a configure
> test (run if --enable-mini-gmp was used) to define it.

Maybe it would be simplest to only have mini-gmp define the
mp_bits_per_limb, and let mpfr (and other applications which need this
info at compile time) use a configure test like

  AC_COMPUTE_INT(mini_gmp_limb_bits, [sizeof(mp_limb_t) * CHAR_BIT],
[#include "mini-gmp.h" 
#include <limits.h>])

This check should work fine with cross compilation (thanks to advanced
magic in autoconf). I can't think of any portable and cross-compile safe
way to instead examine the value of mp_bits_per_limb.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list