mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:01:48 +00:00
[C++]
- 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:
parent
fc031fc414
commit
2318d9807c
1 changed files with 201 additions and 235 deletions
|
@ -31,263 +31,229 @@
|
|||
#undef tan
|
||||
#undef tanh
|
||||
|
||||
inline double
|
||||
abs(double __x)
|
||||
{ return fabs(__x); }
|
||||
|
||||
inline float
|
||||
abs(float __x)
|
||||
{ return fabsf(__x); }
|
||||
|
||||
inline long double
|
||||
abs(long double __x)
|
||||
{ return fabsl(__x); }
|
||||
|
||||
inline float
|
||||
acos(float __x)
|
||||
{ return acosf(__x); }
|
||||
|
||||
inline long double
|
||||
acos(long double __x)
|
||||
{ return acosl(__x); }
|
||||
|
||||
inline float
|
||||
asin(float __x)
|
||||
{ return asinf(__x); }
|
||||
|
||||
inline long double
|
||||
asin(long double __x)
|
||||
{ return asinl(__x); }
|
||||
|
||||
inline float
|
||||
atan(float __x)
|
||||
{ return atanf(__x); }
|
||||
|
||||
inline long double
|
||||
atan(long double __x)
|
||||
{ return atanl(__x); }
|
||||
|
||||
inline float
|
||||
atan2(float __y, float __x)
|
||||
{ return atan2f(__y, __x); }
|
||||
|
||||
inline long double
|
||||
atan2(long double __y, long double __x)
|
||||
{ return atan2l(__y, __x); }
|
||||
|
||||
inline float
|
||||
ceil(float __x)
|
||||
{ return ceilf(__x); }
|
||||
|
||||
inline long double
|
||||
ceil(long double __x)
|
||||
{ return ceill(__x); }
|
||||
|
||||
inline float
|
||||
cos(float __x)
|
||||
{ return cosf(__x); }
|
||||
|
||||
inline long double
|
||||
cos(long double __x)
|
||||
{ return cosl(__x); }
|
||||
|
||||
inline float
|
||||
cosh(float __x)
|
||||
{ return coshf(__x); }
|
||||
|
||||
inline long double
|
||||
cosh(long double __x)
|
||||
{ return coshl(__x); }
|
||||
|
||||
inline float
|
||||
exp(float __x)
|
||||
{ return expf(__x); }
|
||||
|
||||
inline long double
|
||||
exp(long double __x)
|
||||
{ return expl(__x); }
|
||||
|
||||
inline float
|
||||
fabs(float __x)
|
||||
{ return fabsf(__x); }
|
||||
|
||||
inline long double
|
||||
fabs(long double __x)
|
||||
{ return fabsl(__x); }
|
||||
|
||||
inline float
|
||||
floor(float __x)
|
||||
{ return floorf(__x); }
|
||||
|
||||
inline long double
|
||||
floor(long double __x)
|
||||
{ return floorl(__x); }
|
||||
|
||||
inline float
|
||||
fmod(float __x, float __y)
|
||||
{ return fmodf(__x, __y); }
|
||||
|
||||
inline long double
|
||||
fmod(long double __x, long double __y)
|
||||
{ return fmodl(__x, __y); }
|
||||
|
||||
inline float
|
||||
frexp(float __x, int* __exp)
|
||||
{ return frexpf(__x, __exp); }
|
||||
|
||||
inline long double
|
||||
frexp(long double __x, int* __exp)
|
||||
{ return frexpl(__x, __exp); }
|
||||
|
||||
inline float
|
||||
ldexp(float __x, int __exp)
|
||||
{ return ldexpf(__x, __exp); }
|
||||
|
||||
inline long double
|
||||
ldexp(long double __x, int __exp)
|
||||
{ return ldexpl(__x, __exp); }
|
||||
|
||||
inline float
|
||||
log(float __x)
|
||||
{ return logf(__x); }
|
||||
|
||||
inline long double
|
||||
log(long double __x)
|
||||
{ return logl(__x); }
|
||||
|
||||
inline float
|
||||
log10(float __x)
|
||||
{ return log10f(__x); }
|
||||
|
||||
inline long double
|
||||
log10(long double __x)
|
||||
{ return log10l(__x); }
|
||||
|
||||
inline float
|
||||
modf(float __x, float* __iptr)
|
||||
{ return modff(__x, __iptr); }
|
||||
|
||||
inline long double
|
||||
modf(long double __x, long double* __iptr)
|
||||
{ return modfl(__x, __iptr); }
|
||||
|
||||
inline float
|
||||
pow(float __x, float __y)
|
||||
{ return powf(__x, __y); }
|
||||
|
||||
inline long double
|
||||
pow(long double __x, long double __y)
|
||||
{ return powl(__x, __y); }
|
||||
|
||||
inline double
|
||||
pow(double __x, int __i)
|
||||
{ return pow(__x, static_cast<double>(__i)); }
|
||||
|
||||
inline float
|
||||
pow(float __x, int __n)
|
||||
{ return powf(__x, static_cast<float>(__n)); }
|
||||
|
||||
inline long double
|
||||
pow(long double __x, int __n)
|
||||
{ return powl(__x, static_cast<long double>(__n)); }
|
||||
|
||||
inline float
|
||||
sin(float __x)
|
||||
{ return sinf(__x); }
|
||||
|
||||
inline long double
|
||||
sin(long double __x)
|
||||
{ return sinl(__x); }
|
||||
|
||||
inline float
|
||||
sinh(float __x)
|
||||
{ return sinhf(__x); }
|
||||
|
||||
inline long double
|
||||
sinh(long double __x)
|
||||
{ return sinhl(__x); }
|
||||
|
||||
inline float
|
||||
sqrt(float __x)
|
||||
{ return sqrtf(__x); }
|
||||
|
||||
inline long double
|
||||
sqrt(long double __x)
|
||||
{ return sqrtl(__x); }
|
||||
|
||||
inline float
|
||||
tan(float __x)
|
||||
{ return tanf(__x); }
|
||||
|
||||
inline long double
|
||||
tan(long double __x)
|
||||
{ return tanl(__x); }
|
||||
|
||||
inline float
|
||||
tanh(float __x)
|
||||
{ return tanhf(__x); }
|
||||
|
||||
inline long double
|
||||
tanh(long double __x)
|
||||
{ return tanhl(__x); }
|
||||
|
||||
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); }
|
||||
|
||||
inline float
|
||||
abs(float __x)
|
||||
{ return fabsf(__x); }
|
||||
|
||||
inline long double
|
||||
abs(long double __x)
|
||||
{ return fabsl(__x); }
|
||||
|
||||
using ::abs;
|
||||
using ::acos;
|
||||
|
||||
inline float
|
||||
acos(float __x)
|
||||
{ return acosf(__x); }
|
||||
|
||||
inline long double
|
||||
acos(long double __x)
|
||||
{ return acosl(__x); }
|
||||
|
||||
using ::asin;
|
||||
|
||||
inline float
|
||||
asin(float __x)
|
||||
{ return asinf(__x); }
|
||||
|
||||
inline long double
|
||||
asin(long double __x)
|
||||
{ return asinl(__x); }
|
||||
|
||||
using ::atan;
|
||||
|
||||
inline float
|
||||
atan(float __x)
|
||||
{ return atanf(__x); }
|
||||
|
||||
inline long double
|
||||
atan(long double __x)
|
||||
{ return atanl(__x); }
|
||||
|
||||
using ::atan2;
|
||||
|
||||
inline float
|
||||
atan2(float __y, float __x)
|
||||
{ return atan2f(__y, __x); }
|
||||
|
||||
inline long double
|
||||
atan2(long double __y, long double __x)
|
||||
{ return atan2l(__y, __x); }
|
||||
|
||||
using ::ceil;
|
||||
|
||||
inline float
|
||||
ceil(float __x)
|
||||
{ return ceilf(__x); }
|
||||
|
||||
inline long double
|
||||
ceil(long double __x)
|
||||
{ return ceill(__x); }
|
||||
|
||||
using ::cos;
|
||||
|
||||
inline float
|
||||
cos(float __x)
|
||||
{ return cosf(__x); }
|
||||
|
||||
inline long double
|
||||
cos(long double __x)
|
||||
{ return cosl(__x); }
|
||||
|
||||
using ::cosh;
|
||||
|
||||
inline float
|
||||
cosh(float __x)
|
||||
{ return coshf(__x); }
|
||||
|
||||
inline long double
|
||||
cosh(long double __x)
|
||||
{ return coshl(__x); }
|
||||
|
||||
using ::exp;
|
||||
|
||||
inline float
|
||||
exp(float __x)
|
||||
{ return expf(__x); }
|
||||
|
||||
inline long double
|
||||
exp(long double __x)
|
||||
{ return expl(__x); }
|
||||
|
||||
using ::fabs;
|
||||
|
||||
inline float
|
||||
fabs(float __x)
|
||||
{ return fabsf(__x); }
|
||||
|
||||
inline long double
|
||||
fabs(long double __x)
|
||||
{ return fabsl(__x); }
|
||||
|
||||
using ::floor;
|
||||
|
||||
inline float
|
||||
floor(float __x)
|
||||
{ return floorf(__x); }
|
||||
|
||||
inline long double
|
||||
floor(long double __x)
|
||||
{ return floorl(__x); }
|
||||
|
||||
using ::fmod;
|
||||
|
||||
inline float
|
||||
fmod(float __x, float __y)
|
||||
{ return fmodf(__x, __y); }
|
||||
|
||||
inline long double
|
||||
fmod(long double __x, long double __y)
|
||||
{ return fmodl(__x, __y); }
|
||||
|
||||
using ::frexp;
|
||||
|
||||
inline float
|
||||
frexp(float __x, int* __exp)
|
||||
{ return frexpf(__x, __exp); }
|
||||
|
||||
inline long double
|
||||
frexp(long double __x, int* __exp)
|
||||
{ return frexpl(__x, __exp); }
|
||||
|
||||
using ::ldexp;
|
||||
|
||||
inline float
|
||||
ldexp(float __x, int __exp)
|
||||
{ return ldexpf(__x, __exp); }
|
||||
|
||||
inline long double
|
||||
ldexp(long double __x, int __exp)
|
||||
{ return ldexpl(__x, __exp); }
|
||||
|
||||
using ::log;
|
||||
|
||||
inline float
|
||||
log(float __x)
|
||||
{ return logf(__x); }
|
||||
|
||||
inline long double
|
||||
log(long double __x)
|
||||
{ return logl(__x); }
|
||||
|
||||
using ::log10;
|
||||
|
||||
inline float
|
||||
log10(float __x)
|
||||
{ return log10f(__x); }
|
||||
|
||||
inline long double
|
||||
log10(long double __x)
|
||||
{ return log10l(__x); }
|
||||
|
||||
using ::modf;
|
||||
|
||||
inline float
|
||||
modf(float __x, float* __iptr)
|
||||
{ return modff(__x, __iptr); }
|
||||
|
||||
inline long double
|
||||
modf(long double __x, long double* __iptr)
|
||||
{ return modfl(__x, __iptr); }
|
||||
|
||||
using ::pow;
|
||||
|
||||
inline float
|
||||
pow(float __x, float __y)
|
||||
{ return powf(__x, __y); }
|
||||
|
||||
inline long double
|
||||
pow(long double __x, long double __y)
|
||||
{ return powl(__x, __y); }
|
||||
|
||||
inline double
|
||||
pow(double __x, int __i)
|
||||
{ return pow(__x, static_cast<double>(__i)); }
|
||||
|
||||
inline float
|
||||
pow(float __x, int __n)
|
||||
{ return powf(__x, static_cast<float>(__n)); }
|
||||
|
||||
inline long double
|
||||
pow(long double __x, int __n)
|
||||
{ return powl(__x, static_cast<long double>(__n)); }
|
||||
|
||||
using ::sin;
|
||||
|
||||
inline float
|
||||
sin(float __x)
|
||||
{ return sinf(__x); }
|
||||
|
||||
inline long double
|
||||
sin(long double __x)
|
||||
{ return sinl(__x); }
|
||||
|
||||
using ::sinh;
|
||||
|
||||
inline float
|
||||
sinh(float __x)
|
||||
{ return sinhf(__x); }
|
||||
|
||||
inline long double
|
||||
sinh(long double __x)
|
||||
{ return sinhl(__x); }
|
||||
|
||||
using ::sqrt;
|
||||
|
||||
inline float
|
||||
sqrt(float __x)
|
||||
{ return sqrtf(__x); }
|
||||
|
||||
inline long double
|
||||
sqrt(long double __x)
|
||||
{ return sqrtl(__x); }
|
||||
|
||||
using ::tan;
|
||||
|
||||
inline float
|
||||
tan(float __x)
|
||||
{ return tanf(__x); }
|
||||
|
||||
inline long double
|
||||
tan(long double __x)
|
||||
{ return tanl(__x); }
|
||||
|
||||
using ::tanh;
|
||||
|
||||
inline float
|
||||
tanh(float __x)
|
||||
{ return tanhf(__x); }
|
||||
|
||||
inline long double
|
||||
tanh(long double __x)
|
||||
{ return tanhl(__x); }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue