diff options
Diffstat (limited to 'lib/libc/gen/isinf.c')
-rw-r--r-- | lib/libc/gen/isinf.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/libc/gen/isinf.c b/lib/libc/gen/isinf.c index 9af1ca9657b..a7b991b1c7f 100644 --- a/lib/libc/gen/isinf.c +++ b/lib/libc/gen/isinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinf.c,v 1.2 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isinf.c,v 1.3 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,9 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> int __isinf(double d) @@ -28,9 +30,23 @@ __isinf(double d) } int -isinff(float f) +__isinff(float f) { struct ieee_single *p = (struct ieee_single *)&f; return (p->sng_exp == SNG_EXP_INFNAN && p->sng_frac == 0); } + +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__isinfl, __isinf); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(isinf, __isinf); +__weak_alias(isinff, __isinff); +#endif /* __weak_alias */ |