[libcxx-commits] [PATCH] D99767: [libc++][AIX] Fix abs and div overload issue for compilers on AIX

Jason Liu via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 9 07:47:56 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf3d7536b24f1: [libc++] Fix abs and div overload issue for compilers on AIX (authored by jasonliu).
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99767/new/

https://reviews.llvm.org/D99767

Files:
  libcxx/include/cmath
  libcxx/include/stdlib.h


Index: libcxx/include/stdlib.h
===================================================================
--- libcxx/include/stdlib.h
+++ libcxx/include/stdlib.h
@@ -103,7 +103,7 @@
 #endif
 
 // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX)
+#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
 inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
   return __builtin_labs(__x);
 }
@@ -112,9 +112,9 @@
   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__)
 inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {
   return __builtin_fabsf(__lcpp_x); // Use builtins to prevent needing math.h
 }
@@ -127,7 +127,7 @@
 abs(long double __lcpp_x) _NOEXCEPT {
   return __builtin_fabsl(__lcpp_x);
 }
-#endif // !(defined(_AIX) || defined(__sun__))
+#endif // !defined(__sun__)
 
 // div
 
@@ -138,7 +138,7 @@
 #endif
 
 // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined
-#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX)
+#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__)
 inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
   return ::ldiv(__x, __y);
 }
@@ -148,7 +148,7 @@
   return ::lldiv(__x, __y);
 }
 #endif // _LIBCPP_HAS_NO_LONG_LONG
-#endif // _LIBCPP_MSVCRT / __sun__ / _AIX
+#endif // _LIBCPP_MSVCRT / __sun__
 } // extern "C++"
 #endif  // __cplusplus
 
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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99767.336455.patch
Type: text/x-patch
Size: 1950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210409/21da0805/attachment.bin>


More information about the libcxx-commits mailing list