- Make <cmath> functions available in top-level namespace. Fixes stlport build with VS2015.
- Remove unused __cmath_power and __pow_helper

svn path=/trunk/; revision=68485
This commit is contained in:
Thomas Faber 2015-07-20 22:35:06 +00:00
parent fc031fc414
commit 2318d9807c

View file

@ -31,22 +31,6 @@
#undef tan
#undef tanh
namespace std
{
// Forward declaration of a helper function. This really should be
// an `exported' forward declaration.
template<typename _Tp>
_Tp __cmath_power(_Tp, unsigned int);
template<typename _Tp>
inline _Tp
__pow_helper(_Tp __x, int __n)
{
return __n < 0
? _Tp(1)/__cmath_power(__x, -__n)
: __cmath_power(__x, __n);
}
inline double
abs(double __x)
{ return fabs(__x); }
@ -59,8 +43,6 @@ namespace std
abs(long double __x)
{ return fabsl(__x); }
using ::acos;
inline float
acos(float __x)
{ return acosf(__x); }
@ -69,8 +51,6 @@ namespace std
acos(long double __x)
{ return acosl(__x); }
using ::asin;
inline float
asin(float __x)
{ return asinf(__x); }
@ -79,8 +59,6 @@ namespace std
asin(long double __x)
{ return asinl(__x); }
using ::atan;
inline float
atan(float __x)
{ return atanf(__x); }
@ -89,8 +67,6 @@ namespace std
atan(long double __x)
{ return atanl(__x); }
using ::atan2;
inline float
atan2(float __y, float __x)
{ return atan2f(__y, __x); }
@ -99,8 +75,6 @@ namespace std
atan2(long double __y, long double __x)
{ return atan2l(__y, __x); }
using ::ceil;
inline float
ceil(float __x)
{ return ceilf(__x); }
@ -109,8 +83,6 @@ namespace std
ceil(long double __x)
{ return ceill(__x); }
using ::cos;
inline float
cos(float __x)
{ return cosf(__x); }
@ -119,8 +91,6 @@ namespace std
cos(long double __x)
{ return cosl(__x); }
using ::cosh;
inline float
cosh(float __x)
{ return coshf(__x); }
@ -129,8 +99,6 @@ namespace std
cosh(long double __x)
{ return coshl(__x); }
using ::exp;
inline float
exp(float __x)
{ return expf(__x); }
@ -139,8 +107,6 @@ namespace std
exp(long double __x)
{ return expl(__x); }
using ::fabs;
inline float
fabs(float __x)
{ return fabsf(__x); }
@ -149,8 +115,6 @@ namespace std
fabs(long double __x)
{ return fabsl(__x); }
using ::floor;
inline float
floor(float __x)
{ return floorf(__x); }
@ -159,8 +123,6 @@ namespace std
floor(long double __x)
{ return floorl(__x); }
using ::fmod;
inline float
fmod(float __x, float __y)
{ return fmodf(__x, __y); }
@ -169,8 +131,6 @@ namespace std
fmod(long double __x, long double __y)
{ return fmodl(__x, __y); }
using ::frexp;
inline float
frexp(float __x, int* __exp)
{ return frexpf(__x, __exp); }
@ -179,8 +139,6 @@ namespace std
frexp(long double __x, int* __exp)
{ return frexpl(__x, __exp); }
using ::ldexp;
inline float
ldexp(float __x, int __exp)
{ return ldexpf(__x, __exp); }
@ -189,8 +147,6 @@ namespace std
ldexp(long double __x, int __exp)
{ return ldexpl(__x, __exp); }
using ::log;
inline float
log(float __x)
{ return logf(__x); }
@ -199,8 +155,6 @@ namespace std
log(long double __x)
{ return logl(__x); }
using ::log10;
inline float
log10(float __x)
{ return log10f(__x); }
@ -209,8 +163,6 @@ namespace std
log10(long double __x)
{ return log10l(__x); }
using ::modf;
inline float
modf(float __x, float* __iptr)
{ return modff(__x, __iptr); }
@ -219,8 +171,6 @@ namespace std
modf(long double __x, long double* __iptr)
{ return modfl(__x, __iptr); }
using ::pow;
inline float
pow(float __x, float __y)
{ return powf(__x, __y); }
@ -241,8 +191,6 @@ namespace std
pow(long double __x, int __n)
{ return powl(__x, static_cast<long double>(__n)); }
using ::sin;
inline float
sin(float __x)
{ return sinf(__x); }
@ -251,8 +199,6 @@ namespace std
sin(long double __x)
{ return sinl(__x); }
using ::sinh;
inline float
sinh(float __x)
{ return sinhf(__x); }
@ -261,8 +207,6 @@ namespace std
sinh(long double __x)
{ return sinhl(__x); }
using ::sqrt;
inline float
sqrt(float __x)
{ return sqrtf(__x); }
@ -271,8 +215,6 @@ namespace std
sqrt(long double __x)
{ return sqrtl(__x); }
using ::tan;
inline float
tan(float __x)
{ return tanf(__x); }
@ -281,8 +223,6 @@ namespace std
tan(long double __x)
{ return tanl(__x); }
using ::tanh;
inline float
tanh(float __x)
{ return tanhf(__x); }
@ -290,4 +230,30 @@ namespace std
inline long double
tanh(long double __x)
{ return tanhl(__x); }
namespace std
{
using ::abs;
using ::acos;
using ::asin;
using ::atan;
using ::atan2;
using ::ceil;
using ::cos;
using ::cosh;
using ::exp;
using ::fabs;
using ::floor;
using ::fmod;
using ::frexp;
using ::ldexp;
using ::log;
using ::log10;
using ::modf;
using ::pow;
using ::sin;
using ::sinh;
using ::sqrt;
using ::tan;
using ::tanh;
}