From 7f02a5261b7c02324f035b85dc75cab03796bbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 18 Aug 2016 14:48:26 +0300 Subject: [PATCH 1/2] Make the "softfloat" log2/log2f/exp2/exp2f call the msvcrt log/pow functions These work properly and won't do infinite recursion on certain values, etc. --- mingw-w64-crt/math/softmath/exp2.c | 4 ++-- mingw-w64-crt/math/softmath/exp2f.c | 4 ++-- mingw-w64-crt/math/softmath/log2.c | 4 ++-- mingw-w64-crt/math/softmath/log2f.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mingw-w64-crt/math/softmath/exp2.c b/mingw-w64-crt/math/softmath/exp2.c index 61e5955..0291d97 100644 --- a/mingw-w64-crt/math/softmath/exp2.c +++ b/mingw-w64-crt/math/softmath/exp2.c @@ -42,9 +42,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "softmath_private.h" +#include double exp2(double x) { - return bsd__ieee754_pow(2, x); + return pow(2, x); } diff --git a/mingw-w64-crt/math/softmath/exp2f.c b/mingw-w64-crt/math/softmath/exp2f.c index 6dee1bb..11e279d 100644 --- a/mingw-w64-crt/math/softmath/exp2f.c +++ b/mingw-w64-crt/math/softmath/exp2f.c @@ -42,9 +42,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "softmath_private.h" +#include float exp2f(float x) { - return bsd__ieee754_powf(2, x); + return powf(2, x); } diff --git a/mingw-w64-crt/math/softmath/log2.c b/mingw-w64-crt/math/softmath/log2.c index c35a7a3..756d8f1 100644 --- a/mingw-w64-crt/math/softmath/log2.c +++ b/mingw-w64-crt/math/softmath/log2.c @@ -42,9 +42,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "softmath_private.h" +#include double log2(double x) { - return softmath_log(x) / 0.69314718246459960938; + return log(x) / 0.69314718246459960938; } diff --git a/mingw-w64-crt/math/softmath/log2f.c b/mingw-w64-crt/math/softmath/log2f.c index 73d9659..055d0d4 100644 --- a/mingw-w64-crt/math/softmath/log2f.c +++ b/mingw-w64-crt/math/softmath/log2f.c @@ -42,9 +42,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "softmath_private.h" +#include float log2f(float x) { - return softmath_logf(x) / 0.69314718246459960938f; + return logf(x) / 0.69314718246459960938f; } -- 2.7.4