From 84b6c1f402b2ce755968419d4b31c20b4dbf2135 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 16 Mar 2015 14:27:44 +0000 Subject: [PATCH] Make *abs() and *div() work on CloudABI. According to POSIX, *abs() and *div() are allowed to be macros (in addition to being functions). Make sure we undefine these, so that std::*abs() and std::*div() work as expected. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232379 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/cinttypes | 2 ++ include/cstdlib | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/cinttypes b/include/cinttypes index 786692b8..cfd763c9 100644 --- a/include/cinttypes +++ b/include/cinttypes @@ -247,7 +247,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD using::imaxdiv_t; +#undef imaxabs using::imaxabs; +#undef imaxdiv using::imaxdiv; using::strtoimax; using::strtoumax; diff --git a/include/cstdlib b/include/cstdlib index 152b891d..298040e3 100644 --- a/include/cstdlib +++ b/include/cstdlib @@ -131,14 +131,20 @@ using ::getenv; using ::system; using ::bsearch; using ::qsort; +#undef abs using ::abs; +#undef labs using ::labs; #ifndef _LIBCPP_HAS_NO_LONG_LONG +#undef llabs using ::llabs; #endif // _LIBCPP_HAS_NO_LONG_LONG +#undef div using ::div; +#undef ldiv using ::ldiv; #ifndef _LIBCPP_HAS_NO_LONG_LONG +#undef lldiv using ::lldiv; #endif // _LIBCPP_HAS_NO_LONG_LONG using ::mblen;