summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2015-05-29 09:23:20 +0000
committerandrew <andrew@FreeBSD.org>2015-05-29 09:23:20 +0000
commitac994cae1dd37f33737245b73c93680c33390f95 (patch)
treed5317d4d94ed5ee76a522f2cbb159e771edf2121
parent7856dd8122c785631fb89280aaf2b183f5a01b0a (diff)
downloadFreeBSD-src-ac994cae1dd37f33737245b73c93680c33390f95.zip
FreeBSD-src-ac994cae1dd37f33737245b73c93680c33390f95.tar.gz
Fix __isinfl on architectures where double == long double. This is the
case on at least ARM and PowerPC. MFC after: 1 week
-rw-r--r--lib/libc/gen/isinf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/gen/isinf.c b/lib/libc/gen/isinf.c
index 4a4152a..0eb8b9f 100644
--- a/lib/libc/gen/isinf.c
+++ b/lib/libc/gen/isinf.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <machine/float.h>
+
#include <math.h>
#include "fpmath.h"
@@ -62,9 +64,9 @@ __isinfl(long double e)
u.e = e;
mask_nbit_l(u);
-#ifndef __alpha__
- return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0);
-#else
+#if LDBL_MANT_DIG == 53
return (u.bits.exp == 2047 && u.bits.manl == 0 && u.bits.manh == 0);
+#else
+ return (u.bits.exp == 32767 && u.bits.manl == 0 && u.bits.manh == 0);
#endif
}
OpenPOWER on IntegriCloud