diff --git a/libbf.c b/libbf.c index abdbece..bc78860 100644 --- a/libbf.c +++ b/libbf.c @@ -5365,19 +5365,20 @@ int bf_acos(bf_t *r, const bf_t *a, limb_t prec, bf_flags_t flags) #if LIMB_BITS == 64 /* Note: we assume __int128 is available */ +/* uint128_t defined in libbf.h */ #define muldq(r1, r0, a, b) \ do { \ - unsigned __int128 __t; \ - __t = (unsigned __int128)(a) * (unsigned __int128)(b); \ + uint128_t __t; \ + __t = (uint128_t)(a) * (uint128_t)(b); \ r0 = __t; \ r1 = __t >> 64; \ } while (0) #define divdq(q, r, a1, a0, b) \ do { \ - unsigned __int128 __t; \ + uint128_t __t; \ limb_t __b = (b); \ - __t = ((unsigned __int128)(a1) << 64) | (a0); \ + __t = ((uint128_t)(a1) << 64) | (a0); \ q = __t / __b; \ r = __t % __b; \ } while (0) diff --git a/libbf.h b/libbf.h index d89d09c..ebf425c 100644 --- a/libbf.h +++ b/libbf.h @@ -36,8 +36,8 @@ #define LIMB_BITS (1 << LIMB_LOG2_BITS) #if LIMB_BITS == 64 -typedef __int128 int128_t; -typedef unsigned __int128 uint128_t; +__extension__ typedef __int128 int128_t; +__extension__ typedef unsigned __int128 uint128_t; typedef int64_t slimb_t; typedef uint64_t limb_t; typedef uint128_t dlimb_t;