From: Eric Fiselier Date: Wed, 18 Mar 2015 15:24:18 +0000 (+0000) Subject: Provide std::abs() in on Solaris. X-Git-Tag: llvmorg-3.7.0-rc1~8896 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2c276e4480d9a26b679a59321bdd8fd449e97db;p=platform%2Fupstream%2Fllvm.git 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. llvm-svn: 232641 --- diff --git a/libcxx/include/cmath b/libcxx/include/cmath index b340b4d..5f9aaed 100644 --- a/libcxx/include/cmath +++ b/libcxx/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