Provide std::abs(<floating-point>) in <cmath> on Solaris.
1) <cstdlib> header should define std::abs([int|long|long long]) functions. They use "using ::abs" to import these functions (which are declared in <stdlib.h>) into std namespace. 2) <cmath> header should define std::abs([float|double|long double]) function. If we try define new functions in std namespace, then it will cause compile error in <cstdlib> because "using ::abs" will try import not only [int|long|long long] functions, but also [float|double|long double] which are defined in <math.h> header on solaris. Patch by C Bergstrom. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232641 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9959bf0850
commit
0b6f8ed1c7
@ -654,6 +654,10 @@ using ::double_t;
|
|||||||
|
|
||||||
// abs
|
// abs
|
||||||
|
|
||||||
|
#if defined(__sun__)
|
||||||
|
using ::abs;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(_AIX) && !defined(__sun__)
|
#if !defined(_AIX) && !defined(__sun__)
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
float
|
float
|
||||||
|
Loading…
x
Reference in New Issue
Block a user