From a7e0bc8e16b4ecc101931eb8c26ca27ab5cbae3f Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Wed, 29 Sep 2004 14:30:03 +0000 Subject: [PATCH] - Fixed fabs() for PowerPC soft-float support; previously, the function definitions would clash. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14739 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/math_fabs.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/library/math_fabs.c b/library/math_fabs.c index d929781..c6b1868 100644 --- a/library/math_fabs.c +++ b/library/math_fabs.c @@ -1,5 +1,5 @@ /* - * $Id: math_fabs.c,v 1.3 2004-09-29 14:17:44 obarthel Exp $ + * $Id: math_fabs.c,v 1.4 2004-09-29 14:30:03 obarthel Exp $ * * :ts=4 * @@ -126,8 +126,14 @@ __fabs(double x) /****************************************************************************/ +#if defined(__PPC__) + +/****************************************************************************/ + #if defined(PPC_FLOATING_POINT_SUPPORT) +/****************************************************************************/ + INLINE static const double __fabs(double x) { @@ -141,10 +147,35 @@ __fabs(double x) } +/****************************************************************************/ + +#else + +/****************************************************************************/ + +INLINE static const double +__fabs(double x) +{ + double res; + + if(x < 0) + res = (-x); + else + res = x; + + return res; +} + +/****************************************************************************/ + #endif /* PPC_FLOATING_POINT_SUPPORT */ /****************************************************************************/ +#endif /* __PPC__ */ + +/****************************************************************************/ + double fabs(double x) {