From fe3d470d2d9c3bb7728b8eb60c47d40bc4e2ce1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 14 Nov 2017 10:08:21 +0100 Subject: [PATCH] [liba] Fixed Gamma function bug. There was a problem with the definition of ldexp, used in b_log__D.c Change-Id: I83d012815e38b76efa730c1a3d259ec276e15f11 --- liba/Makefile | 1 - liba/include/math.h | 2 +- liba/src/external/openbsd/include/math.h | 1 - liba/src/ldexp.c | 9 --------- 4 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 liba/src/ldexp.c diff --git a/liba/Makefile b/liba/Makefile index 699537ada..70fdf5aee 100644 --- a/liba/Makefile +++ b/liba/Makefile @@ -12,7 +12,6 @@ objs += $(addprefix liba/src/, \ fpclassify.o \ fpclassifyf.o \ ieee754.o \ - ldexp.o \ malloc.o \ memcmp.o \ memcpy.o \ diff --git a/liba/include/math.h b/liba/include/math.h index e3d5a0412..5b890cc3e 100644 --- a/liba/include/math.h +++ b/liba/include/math.h @@ -178,7 +178,7 @@ double trunc(double x); #define fabs(x) __builtin_fabs(x) #define floor(x) __builtin_floor(x) #define fmod(x, y) __builtin_fmod(x, y) -#define ldexp(x, n) __builtin_ldexp(x, n) +#define ldexp(x, n) __builtin_scalbn(x, n) #define lgamma(x) __builtin_lgamma(x) #define lgamma_r(x, signgamp) __builtin_lgamma_r(x, signgamp) #define log(x) __builtin_log(x) diff --git a/liba/src/external/openbsd/include/math.h b/liba/src/external/openbsd/include/math.h index 719d3a0bc..a18737739 100644 --- a/liba/src/external/openbsd/include/math.h +++ b/liba/src/external/openbsd/include/math.h @@ -61,7 +61,6 @@ #undef fabs #undef floor #undef fmod -#undef ldexp #undef lgamma #undef lgamma_r #undef log diff --git a/liba/src/ldexp.c b/liba/src/ldexp.c deleted file mode 100644 index 0fa60bc79..000000000 --- a/liba/src/ldexp.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#undef ldexp - -// For some reason, OpenBSD's libm defines ldexpf but doesn't define ldexp - -double ldexp(double x, int n) { - return scalbn(x, n); -}