diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-30 22:02:30 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-30 22:02:30 +0000 |
commit | 24079773bcf3b4a4ddf713db9dbace26d58a497e (patch) | |
tree | 57ba37df114b40ae6ef22d404832e6410268cfdd /libstdc++-v3 | |
parent | f2004094f6551db0f789071bbbeee4ac6279addb (diff) | |
download | gcc-24079773bcf3b4a4ddf713db9dbace26d58a497e.tar.gz |
2005-05-30 Paolo Carlini <pcarlini@suse.de>
* include/std/std_complex.h (log(const complex<_Tp>&)): When
_GLIBCXX_USE_C99_COMPLEX, forward to __builtin_clog/clogf/clogl.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100376 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/std_complex.h | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a572b0bfaa5..31357005d89 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2005-05-30 Paolo Carlini <pcarlini@suse.de> + + * include/std/std_complex.h (log(const complex<_Tp>&)): When + _GLIBCXX_USE_C99_COMPLEX, forward to __builtin_clog/clogf/clogl. + 2005-05-28 Paolo Carlini <pcarlini@suse.de> Revert: diff --git a/libstdc++-v3/include/std/std_complex.h b/libstdc++-v3/include/std/std_complex.h index 6c1e0033730..80020756789 100644 --- a/libstdc++-v3/include/std/std_complex.h +++ b/libstdc++-v3/include/std/std_complex.h @@ -749,7 +749,7 @@ namespace std __complex_log(const complex<_Tp>& __z) { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); } - /* +#if _GLIBCXX_USE_C99_COMPLEX inline __complex__ float __complex_log(__complex__ float __z) { return __builtin_clogf(__z); } @@ -758,14 +758,16 @@ namespace std inline __complex__ long double __complex_log(const __complex__ long double& __z) - { return __builtin_clogl(__z); } */ + { return __builtin_clogl(__z); } - // FIXME: Currently we don't use built-ins for log() because of some - // obscure user name-space issues. So, we use the generic version - // which is why we don't use __z.__rep() in the call below. + template<typename _Tp> + inline complex<_Tp> + log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); } +#else template<typename _Tp> inline complex<_Tp> log(const complex<_Tp>& __z) { return __complex_log(__z); } +#endif template<typename _Tp> inline complex<_Tp> |