⛏️ index : buildtools.git

author Adrien Destugues - PulkoMandy <pulkomandy@pulkomandy.tk> 2012-10-27 15:42:44.0 +02:00:00
committer Adrien Destugues - PulkoMandy <pulkomandy@pulkomandy.tk> 2012-10-27 15:42:44.0 +02:00:00
commit
72f47ffea0536ad5aa38bc5395d3eee959d8002c [patch]
tree
f2a086de6f545965b05ef8b3ba6aceacd3c094e1
parent
12728552279ddbc66d9f2e36d5a007fffadb5ba0
download
72f47ffea0536ad5aa38bc5395d3eee959d8002c.tar.gz

Add missing tan(), tanh() and log10() for std::complex. These are part of the C++ standard, I don't know how they went missing in our version. http://www.cplusplus.com/reference/std/complex/

They are needed to build MathGL library, and likely other stuff.

Diff

 legacy/gcc/libstdc++/std/complext.h | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/legacy/gcc/libstdc++/std/complext.h b/legacy/gcc/libstdc++/std/complext.h
index 6c55037..0e70194 100644
--- a/legacy/gcc/libstdc++/std/complext.h
+++ a/legacy/gcc/libstdc++/std/complext.h
@@ -311,7 +311,7 @@
}

// Some targets don't provide a prototype for hypot when -ansi.
extern "C" double hypot (double, double) __attribute__ ((const));
//extern "C" double hypot (double, double) __attribute__ ((const));

template <class _FLT> inline _FLT
abs (const complex<_FLT>& x) __attribute__ ((const));
@@ -386,6 +386,22 @@
  sinh (const complex<_FLT>&) __attribute__ ((const));
template <class _FLT> complex<_FLT>
  sqrt (const complex<_FLT>&) __attribute__ ((const));

template <class _FLT> inline complex<_FLT>
tan (const complex<_FLT>& x)
{
  return sin (x) / cos (x);
}
template <class _FLT> inline complex<_FLT>
tanh (const complex<_FLT>& x)
{
  return sinh (x) / cosh (x);
}
template <class _FLT> inline complex<_FLT>
log10 (const complex<_FLT>& x)
{
  return log (x) / log (10.0);
}

template <class _FLT> istream& operator >> (istream&, complex<_FLT>&);
template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);