aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/ldexp.c1
-rw-r--r--lib/msun/src/s_scalbn.c3
-rw-r--r--lib/msun/src/s_scalbnl.c10
3 files changed, 5 insertions, 9 deletions
diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c
index 878271576313..cbbcf0782387 100644
--- a/lib/libc/gen/ldexp.c
+++ b/lib/libc/gen/ldexp.c
@@ -7,3 +7,4 @@ __FBSDID("$FreeBSD$");
*/
#define scalbn ldexp
#include "../../msun/src/s_scalbn.c"
+#undef scalbn
diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c
index 219cd8f0c989..3de663f8b670 100644
--- a/lib/msun/src/s_scalbn.c
+++ b/lib/msun/src/s_scalbn.c
@@ -1,3 +1,4 @@
+#include <float.h>
#include <math.h>
#include <stdint.h>
@@ -32,7 +33,7 @@ double scalbn(double x, int n)
return x;
}
-#if (LDBL_MANT_DIG == 53)
+#if (LDBL_MANT_DIG == 53) && !defined(scalbn)
__weak_reference(scalbn, ldexpl);
__weak_reference(scalbn, scalbnl);
#endif
diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c
index 65a9415b0d21..a79f79b33480 100644
--- a/lib/msun/src/s_scalbnl.c
+++ b/lib/msun/src/s_scalbnl.c
@@ -8,13 +8,7 @@
* manipulation rather than by actually performing an
* exponentiation or a multiplication.
*/
-
-#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
-long double scalbnl(long double x, int n)
-{
- return scalbn(x, n);
-}
-#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
+#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
long double scalbnl(long double x, int n)
{
union IEEEl2bits u;
@@ -42,6 +36,6 @@ long double scalbnl(long double x, int n)
u.xbits.expsign = 0x3fff + n;
return x * u.e;
}
+__strong_reference(scalbnl, ldexpl);
#endif
-__strong_reference(scalbnl, ldexpl);