diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 8ace534c4..c304e5f3b 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2011-01-12 Ralf Corsépius <ralf.corsepius@rtems.org> + + * libm/math/w_tgamma.c: Only build ifndef _DOUBLE_IS_32BITS. + * libm/math/wf_tgamma.c: Map tgamma to tgammaf, ifdef _DOUBLE_IS_32BITS. + 2011-01-12 Jeff Johnston <jjohnstn@redhat.com> * configure.host: Add noinclude variable to allow specification diff --git a/newlib/libm/math/w_tgamma.c b/newlib/libm/math/w_tgamma.c index f24a243bf..c0c011dd0 100644 --- a/newlib/libm/math/w_tgamma.c +++ b/newlib/libm/math/w_tgamma.c @@ -17,6 +17,8 @@ #include "fdlibm.h" +#ifndef _DOUBLE_IS_32BITS + #ifdef __STDC__ double tgamma(double x) #else @@ -42,3 +44,5 @@ return y; #endif } + +#endif /* defined(_DOUBLE_IS_32BITS) */ diff --git a/newlib/libm/math/wf_tgamma.c b/newlib/libm/math/wf_tgamma.c index 2b57d845f..92df39648 100644 --- a/newlib/libm/math/wf_tgamma.c +++ b/newlib/libm/math/wf_tgamma.c @@ -43,3 +43,17 @@ return y; #endif } + +#ifdef _DOUBLE_IS_32BITS + +#ifdef __STDC__ + double tgamma(double x) +#else + double tgamma(x) + double x; +#endif +{ + return (double) tgammaf((float) x); +} + +#endif /* defined(_DOUBLE_IS_32BITS) */