Make *abs() and *div() work on CloudABI.
authorEd Schouten <ed@nuxi.nl>
Mon, 16 Mar 2015 14:27:44 +0000 (14:27 +0000)
committerEd Schouten <ed@nuxi.nl>
Mon, 16 Mar 2015 14:27:44 +0000 (14:27 +0000)
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

libcxx/include/cinttypes
libcxx/include/cstdlib

index 786692b..cfd763c 100644 (file)
@@ -247,7 +247,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 using::imaxdiv_t;
 
+#undef imaxabs
 using::imaxabs;
+#undef imaxdiv
 using::imaxdiv;
 using::strtoimax;
 using::strtoumax;
index 152b891..298040e 100644 (file)
@@ -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;