diff options
| author | Pietro Cerutti <gahr@FreeBSD.org> | 2021-09-20 10:14:39 +0000 |
|---|---|---|
| committer | Pietro Cerutti <gahr@FreeBSD.org> | 2021-09-20 10:45:19 +0000 |
| commit | 3b74b3446c069a4e2d88e23021c83434ea53728c (patch) | |
| tree | 91966d7daf9cdc898c6ad96888603c351d47a900 | |
| parent | 76357fe4e7340d5ccce8b119177669d31d3fc76f (diff) | |
math/libtommath: enable mp_set_double
Reported by: Sébastien Santoro <dereckson@espace-win.org>
Obtained from: https://github.com/libtom/libtommath/pull/476
| -rw-r--r-- | math/libtommath/Makefile | 2 | ||||
| -rw-r--r-- | math/libtommath/files/patch-c1cf80 | 57 |
2 files changed, 58 insertions, 1 deletions
diff --git a/math/libtommath/Makefile b/math/libtommath/Makefile index 2886d7f16922..1fafd2c6243c 100644 --- a/math/libtommath/Makefile +++ b/math/libtommath/Makefile @@ -1,6 +1,6 @@ PORTNAME= libtommath DISTVERSION= 1.2.0 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= math MASTER_SITES= https://github.com/libtom/libtommath/releases/download/v${DISTVERSION}/ DISTNAME= ltm-${DISTVERSION} diff --git a/math/libtommath/files/patch-c1cf80 b/math/libtommath/files/patch-c1cf80 new file mode 100644 index 000000000000..a6137942d9f0 --- /dev/null +++ b/math/libtommath/files/patch-c1cf80 @@ -0,0 +1,57 @@ +From c1cf80738219dbd70cba0c0c1244698aad842ec7 Mon Sep 17 00:00:00 2001 +From: Steffen Jaeckel <s@jaeckel.eu> +Date: Thu, 5 Mar 2020 13:57:07 +0100 +Subject: [PATCH] introduce MP_HAS_SET_DOUBLE + +--- + demo/test.c | 4 ++-- + mp_set_double.c | 2 +- + tommath_private.h | 7 +++++++ + 3 files changed, 10 insertions(+), 3 deletions(-) + +--- demo/test.c.orig 2019-10-22 09:44:44.000000000 +0000 ++++ demo/test.c 2021-09-20 10:02:00.103699000 +0000 +@@ -625,7 +625,7 @@ + + } + +-#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) ++#if defined(MP_HAS_SET_DOUBLE) + static int test_mp_set_double(void) + { + int i; +@@ -2461,7 +2461,7 @@ + T1(mp_read_write_sbin, MP_TO_SBIN), + T1(mp_reduce_2k, MP_REDUCE_2K), + T1(mp_reduce_2k_l, MP_REDUCE_2K_L), +-#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) ++#if defined(MP_HAS_SET_DOUBLE) + T1(mp_set_double, MP_SET_DOUBLE), + #endif + T1(mp_signed_rsh, MP_SIGNED_RSH), +--- bn_mp_set_double.c.orig 2019-10-22 09:44:44.000000000 +0000 ++++ bn_mp_set_double.c 2021-09-20 10:05:36.466235000 +0000 +@@ -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,13 @@ MP_STATIC_ASSERT(prec_geq_min_prec, MP_DEFAULT_DIGIT_COUNT >= MP_MIN_DIGIT_COUNT + */ + #define MP_MAX_DIGIT_COUNT ((INT_MAX - 2) / MP_DIGIT_BIT) + ++#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) \ ++ || defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) \ ++ || defined(__i386__) || defined(_M_X86) \ ++ || 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); |
