Skip to content

Commit

Permalink
Make *abs() and *div() work on CloudABI.
Browse files Browse the repository at this point in the history
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.

llvm-svn: 232379
  • Loading branch information
EdSchouten committed Mar 16, 2015
1 parent 933f51a commit 74bbf7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libcxx/include/cinttypes
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD

using::imaxdiv_t;

#undef imaxabs
using::imaxabs;
#undef imaxdiv
using::imaxdiv;
using::strtoimax;
using::strtoumax;
Expand Down
6 changes: 6 additions & 0 deletions libcxx/include/cstdlib
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 74bbf7c

Please sign in to comment.