From 0b6f8ed1c772afbdb2c28451e67ac5ee7b6092fe Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 18 Mar 2015 15:24:18 +0000 Subject: [PATCH] Provide std::abs() in on Solaris. 1) header should define std::abs([int|long|long long]) functions. They use "using ::abs" to import these functions (which are declared in ) into std namespace. 2) 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 because "using ::abs" will try import not only [int|long|long long] functions, but also [float|double|long double] which are defined in header on solaris. Patch by C Bergstrom. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232641 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/cmath | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cmath b/include/cmath index b340b4d50..5f9aaedd5 100644 --- a/include/cmath +++ b/include/cmath @@ -654,6 +654,10 @@ using ::double_t; // abs +#if defined(__sun__) +using ::abs; +#endif + #if !defined(_AIX) && !defined(__sun__) inline _LIBCPP_INLINE_VISIBILITY float