From 477842ce6b2285868f69c749c4add2dad485dbcf Mon Sep 17 00:00:00 2001 From: das Date: Mon, 27 Oct 2003 01:28:07 +0000 Subject: 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 --- lib/msun/src/e_scalb.c | 5 ++++- lib/msun/src/e_scalbf.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/msun/src') 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); -- cgit v1.1