From 7d0b37d1f1f278d214dd362edaa0c70308cbb016 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Tue, 21 Nov 2023 12:06:37 -0500 Subject: [PATCH] Do not define our own mpfr_sinpi/mpfr_cospi for mpfr 4.2.0 and later (#471) These two functions were added to the MPFR API. Fixes #458. --- src/libm-tester/testerutil.c | 2 ++ src/libm-tester/testerutil.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libm-tester/testerutil.c b/src/libm-tester/testerutil.c index 8e8b8936..688642ca 100644 --- a/src/libm-tester/testerutil.c +++ b/src/libm-tester/testerutil.c @@ -289,6 +289,7 @@ double countULP2sp(float d, mpfr_t c0) { // +#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { mpfr_t frpi, frd; mpfr_inits(frpi, frd, NULL); @@ -314,6 +315,7 @@ void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { mpfr_clears(frpi, frd, NULL); } +#endif void mpfr_lgamma_nosign(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd) { int s; diff --git a/src/libm-tester/testerutil.h b/src/libm-tester/testerutil.h index 7f371414..313bf7b2 100644 --- a/src/libm-tester/testerutil.h +++ b/src/libm-tester/testerutil.h @@ -90,7 +90,9 @@ int cmpDenormsp(float x, mpfr_t fry); double countULPsp(float d, mpfr_t c); double countULP2sp(float d, mpfr_t c); +#if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0) void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); +#endif void mpfr_lgamma_nosign(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd); #endif