This patch lets MoarVM build against libtommath https://github.com/libtom/libtommath/pull/476 Adjusted to work also on PowerPC --- bn_mp_set_double.c.orig +++ bn_mp_set_double.c @@ -3,7 +3,7 @@ /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ -#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) +#if defined(MP_HAS_SET_DOUBLE) mp_err mp_set_double(mp_int *a, double b) { uint64_t frac; --- tommath_private.h.orig +++ tommath_private.h @@ -164,6 +164,14 @@ MP_STATIC_ASSERT(prec_geq_min_prec, MP_PREC >= MP_MIN_PREC) +#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) \ + || defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) \ + || defined(__i386__) || defined(_M_X86) \ + || defined(__POWERPC__) \ + || defined(__aarch64__) || defined(__arm__) +#define MP_HAS_SET_DOUBLE +#endif + /* random number source */ extern MP_PRIVATE mp_err(*s_mp_rand_source)(void *out, size_t size);