This patch allows building the Python 'mpzmodule' under SuSE Linux without having to install the source package of the GMP-libary. The gmp-mparam.h seems to be an internal header file. The patch shouldn't hurt any other platforms.
- #if defined __GLIBC__ && __GLIBC__ >= 2 /*aid building on Linux distributions*/
- #define BITS_PER_MP_LIMB mp_bits_per_limb
This seems like the wrong fix, tying GMP to the version of glibc! (They haven't rolled GMP into glibc, have they?) If GMP 2.0 exposes an mp_bits_per_limb constant, then the correct patch may just be changing BITS_PER_MP_LIMB to mp_bits_per_limb, inside an #ifdef GMP2 if necessary.
Guido van Rossum wrote:
Darn. I just checked it in. Well, if something better comes up, I'll check that in. I personally don't care much about this module (have never bothered to download gmp even so I can't even compile it).
I will investigate the source code of earlier versions of GMP in more detail later. May be Andrew is right, that my patch will hurt people, that happen to use a recent version GLIBC together with in ancient version of GMP. However also I believe this is rather unlikely, it shouldn't break. Sorry for the confusion I've caused.