diff options
author | das <das@FreeBSD.org> | 2003-10-27 01:28:07 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2003-10-27 01:28:07 +0000 |
commit | 477842ce6b2285868f69c749c4add2dad485dbcf (patch) | |
tree | 23413cc59524cac85ee5586d31e1fa426bcc1083 /lib/msun/src | |
parent | 91f5d2caf5fca97cd08b720d16a30a8fd388e68f (diff) | |
download | FreeBSD-src-477842ce6b2285868f69c749c4add2dad485dbcf.zip FreeBSD-src-477842ce6b2285868f69c749c4add2dad485dbcf.tar.gz |
Fix a problem where libm compiled under 5.X would depend on features
that are only in libc.so.5. This broke some 4.X applications linked
to libm and run under 5.X.
Background:
In C99, isinf() and isnan() cannot be implemented as regular
functions. We use macros that call libc functions in 5.X, but for
libm-internal use, we need to use the old versions until the next
time libm's major version number is bumped.
Submitted by: bde
Reported by: imp, kris
Diffstat (limited to 'lib/msun/src')
-rw-r--r-- | lib/msun/src/e_scalb.c | 5 | ||||
-rw-r--r-- | lib/msun/src/e_scalbf.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/msun/src/e_scalb.c b/lib/msun/src/e_scalb.c index 5b66be5..cc35d17 100644 --- a/lib/msun/src/e_scalb.c +++ b/lib/msun/src/e_scalb.c @@ -23,6 +23,9 @@ static char rcsid[] = "$FreeBSD$"; #include "math.h" #include "math_private.h" +/* XXX lost declaration of this and isinf() in math.h but still have funcs. */ +int (isnan)(float x); + #ifdef _SCALB_INT double __ieee754_scalb(double x, int fn) @@ -34,7 +37,7 @@ __ieee754_scalb(double x, double fn) #ifdef _SCALB_INT return scalbn(x,fn); #else - if (isnan(x)||isnan(fn)) return x*fn; + if ((isnan)(x)||(isnan)(fn)) return x*fn; if (!finite(fn)) { if(fn>0.0) return x*fn; else return x/(-fn); diff --git a/lib/msun/src/e_scalbf.c b/lib/msun/src/e_scalbf.c index 0888433..f56e077 100644 --- a/lib/msun/src/e_scalbf.c +++ b/lib/msun/src/e_scalbf.c @@ -20,6 +20,9 @@ static char rcsid[] = "$FreeBSD$"; #include "math.h" #include "math_private.h" +/* XXX lost declaration of this and isnan() in math.h but still have funcs. */ +int (isnanf)(float x); + #ifdef _SCALB_INT float __ieee754_scalbf(float x, int fn) @@ -31,7 +34,7 @@ __ieee754_scalbf(float x, float fn) #ifdef _SCALB_INT return scalbnf(x,fn); #else - if (isnanf(x)||isnanf(fn)) return x*fn; + if ((isnanf)(x)||(isnanf)(fn)) return x*fn; if (!finitef(fn)) { if(fn>(float)0.0) return x*fn; else return x/(-fn); |