summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2010-06-12 17:32:05 +0000
committerdas <das@FreeBSD.org>2010-06-12 17:32:05 +0000
commitcffc98917516f0cc67b1aaada5f93647efe93772 (patch)
tree10a5155b3f734a7fe6d9186f40e77235194e5a35 /lib
parent5deeb3cf12edde9c9f52e91e6e217c1c3bac2694 (diff)
downloadFreeBSD-src-cffc98917516f0cc67b1aaada5f93647efe93772.zip
FreeBSD-src-cffc98917516f0cc67b1aaada5f93647efe93772.tar.gz
Introduce __isnanf() as an alias for isnanf(), and make the isnan()
macro expand to __isnanf() instead of isnanf() for float arguments. This change is needed because isnanf() isn't declared in strict POSIX or C99 mode. Compatibility note: Apps using isnan(float) that are compiled after this change won't link against an older libm. Reported by: Florian Forster <octo@verplant.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/Symbol.map5
-rw-r--r--lib/msun/src/math.h3
-rw-r--r--lib/msun/src/s_isnan.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map
index 39196bd..429a76f 100644
--- a/lib/msun/Symbol.map
+++ b/lib/msun/Symbol.map
@@ -218,3 +218,8 @@ FBSD_1.1 {
cprojf;
cprojl;
};
+
+/* First added in 9.0-CURRENT */
+FBSD_1.2 {
+ __isnanf;
+};
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h
index 601d0ce..9109727 100644
--- a/lib/msun/src/math.h
+++ b/lib/msun/src/math.h
@@ -97,7 +97,7 @@ extern const union __nan_un {
: (sizeof (x) == sizeof (double)) ? isinf(x) \
: __isinfl(x))
#define isnan(x) \
- ((sizeof (x) == sizeof (float)) ? isnanf(x) \
+ ((sizeof (x) == sizeof (float)) ? __isnanf(x) \
: (sizeof (x) == sizeof (double)) ? isnan(x) \
: __isnanl(x))
#define isnormal(x) \
@@ -179,6 +179,7 @@ int __isfinite(double) __pure2;
int __isfinitel(long double) __pure2;
int __isinff(float) __pure2;
int __isinfl(long double) __pure2;
+int __isnanf(float) __pure2;
int __isnanl(long double) __pure2;
int __isnormalf(float) __pure2;
int __isnormal(double) __pure2;
diff --git a/lib/msun/src/s_isnan.c b/lib/msun/src/s_isnan.c
index 5de99ad..0f544db 100644
--- a/lib/msun/src/s_isnan.c
+++ b/lib/msun/src/s_isnan.c
@@ -43,7 +43,7 @@ isnan(double d)
#endif
int
-isnanf(float f)
+__isnanf(float f)
{
union IEEEf2bits u;
@@ -60,3 +60,5 @@ __isnanl(long double e)
mask_nbit_l(u);
return (u.bits.exp == 32767 && (u.bits.manl != 0 || u.bits.manh != 0));
}
+
+__weak_reference(__isnanf, isnanf);
OpenPOWER on IntegriCloud