[PATCH] D18501: Fix <cmath> compilation on FreeBSD
Dimitry Andric via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 27 13:36:47 PDT 2016
dim created this revision.
dim added reviewers: mclow.lists, EricWF, emaste.
dim added subscribers: cfe-commits, bdrewery.
Herald added a subscriber: emaste.
On FreeBSD, a number of math.h functions are actually defined as macros,
such as `signbit()`, `fpclassify()` and others. Since libc++'s <cmath>
attempts to do `using ::signbit;`, `using ::fpclassify;`, and so on,
this results in compile errors:
libcxx/include/cmath:309:9: error: '::signbit' has not been declared
libcxx/include/cmath:310:9: error: '::fpclassify' has not been declared
Here is a patch to exclude `signbit` through `isunordered`, and also
`abs`, which we don't have in math.h.
(Actually, I'm not sure that `::abs` should even be in here, since it is
a stdlib.h function? We don't have it in math.h, in any case.)
@@ -306,6 +306,7 @@
@@ -319,13 +320,14 @@
+#endif // __FreeBSD__
+#if !defined(_AIX) && !defined(__FreeBSD__)
+#endif // !AIX && !__FreeBSD__
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 558 bytes
Desc: not available
More information about the cfe-commits