Index: libcxx/include/cmath =================================================================== --- libcxx/include/cmath +++ libcxx/include/cmath @@ -335,9 +335,7 @@ using ::float_t; using ::double_t; -#ifndef _AIX using ::abs; -#endif using ::acos; using ::acosf; Index: libcxx/include/stdlib.h =================================================================== --- libcxx/include/stdlib.h +++ libcxx/include/stdlib.h @@ -103,18 +103,22 @@ #endif // MSVCRT already has the correct prototype in if __cplusplus is defined -#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) +#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) +#if !defined(_AIX) || (!defined(__ibmxl__) && !defined(__IBMCPP__)) || \ + !defined(__ABS_LONG__) inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT { return __builtin_labs(__x); } +#endif // _AIX #ifndef _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT { return __builtin_llabs(__x); } #endif // _LIBCPP_HAS_NO_LONG_LONG -#endif // !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) +#endif // !defined(_LIBCPP_MSVCRT) && !defined(__sun__) -#if !(defined(_AIX) || defined(__sun__)) +#if !defined(__sun__) +#if !defined(_AIX) || (!defined(__ibmxl__) && !defined(__IBMCPP__)) inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT { return __builtin_fabsf(__lcpp_x); // Use builtins to prevent needing math.h } @@ -127,7 +131,8 @@ abs(long double __lcpp_x) _NOEXCEPT { return __builtin_fabsl(__lcpp_x); } -#endif // !(defined(_AIX) || defined(__sun__)) +#endif // _AIX +#endif // !defined(__sun__) // div @@ -138,7 +143,8 @@ #endif // MSVCRT already has the correct prototype in if __cplusplus is defined -#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) +#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) +#if !defined(_AIX) || (!defined(__ibmxl__) && !defined(__IBMCPP__)) inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT { return ::ldiv(__x, __y); } @@ -148,7 +154,8 @@ return ::lldiv(__x, __y); } #endif // _LIBCPP_HAS_NO_LONG_LONG -#endif // _LIBCPP_MSVCRT / __sun__ / _AIX +#endif // _AIX +#endif // _LIBCPP_MSVCRT / __sun__ } // extern "C++" #endif // __cplusplus