diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-11-13 10:49:43 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-11-13 10:49:43 +0100 |
commit | 63a9d9387f27e5842bed5946c5f1381f209d2918 (patch) | |
tree | 7643ae2434688125ee0b2920d2846cc68049b10a /libraries | |
parent | 212a350547e950cc5be465a3d76e346ef14bf2ab (diff) | |
download | haskell-63a9d9387f27e5842bed5946c5f1381f209d2918.tar.gz |
Fix `integer-gmp2` compilation with GMP 4.x (#9281)
GMP 4.x didn't provide the `mp_bitcnt_t` typedef yet, so we locally
define one if GMP 4.x is detected.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/integer-gmp2/cbits/wrappers.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libraries/integer-gmp2/cbits/wrappers.c b/libraries/integer-gmp2/cbits/wrappers.c index ecee592317..930f5b8508 100644 --- a/libraries/integer-gmp2/cbits/wrappers.c +++ b/libraries/integer-gmp2/cbits/wrappers.c @@ -14,6 +14,15 @@ #include "HsFFI.h" #include "MachDeps.h" +// GMP 4.x compatibility +#if !defined(__GNU_MP_VERSION) +# error __GNU_MP_VERSION not defined +#elif __GNU_MP_VERSION < 4 +# error need GMP 4.0 or later +#elif __GNU_MP_VERSION < 5 +typedef unsigned long int mp_bitcnt_t; +#endif + #if (GMP_NUMB_BITS) != (GMP_LIMB_BITS) # error GMP_NUMB_BITS != GMP_LIMB_BITS not supported #endif |