diff options
author | andrew <andrew@FreeBSD.org> | 2015-05-29 09:23:20 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2015-05-29 09:23:20 +0000 |
commit | ac994cae1dd37f33737245b73c93680c33390f95 (patch) | |
tree | d5317d4d94ed5ee76a522f2cbb159e771edf2121 /lib | |
parent | 7856dd8122c785631fb89280aaf2b183f5a01b0a (diff) | |
download | FreeBSD-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/isinf.c | 8 |
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 } |