Skip to content

Commit 74bbf7c

Browse files
committed
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. llvm-svn: 232379
1 parent 933f51a commit 74bbf7c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libcxx/include/cinttypes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
247247

248248
using::imaxdiv_t;
249249

250+
#undef imaxabs
250251
using::imaxabs;
252+
#undef imaxdiv
251253
using::imaxdiv;
252254
using::strtoimax;
253255
using::strtoumax;

libcxx/include/cstdlib

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,20 @@ using ::getenv;
131131
using ::system;
132132
using ::bsearch;
133133
using ::qsort;
134+
#undef abs
134135
using ::abs;
136+
#undef labs
135137
using ::labs;
136138
#ifndef _LIBCPP_HAS_NO_LONG_LONG
139+
#undef llabs
137140
using ::llabs;
138141
#endif // _LIBCPP_HAS_NO_LONG_LONG
142+
#undef div
139143
using ::div;
144+
#undef ldiv
140145
using ::ldiv;
141146
#ifndef _LIBCPP_HAS_NO_LONG_LONG
147+
#undef lldiv
142148
using ::lldiv;
143149
#endif // _LIBCPP_HAS_NO_LONG_LONG
144150
using ::mblen;

0 commit comments

Comments
 (0)