From a0019047b8acbda653ba0b250940fe29fca38a6e Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Wed, 26 Oct 2016 17:26:00 +0000 Subject: [PATCH] re PR libstdc++/78110 (freestanding libstdc++ fails to compile) 2016-10-26 Bernd Edlinger PR libstdc++/78110 * libsupc++/new_opa.cc: Don't include in a free standing environment. Declare memalign directly in that case. From-SVN: r241591 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/libsupc++/new_opa.cc | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1c878a2a6f3..de98de1236c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2016-10-26 Bernd Edlinger + + PR libstdc++/78110 + * libsupc++/new_opa.cc: Don't include in a free standing + environment. Declare memalign directly in that case. + 2016-10-26 Jonathan Wakely * testsuite/experimental/filesystem/iterators/pop.cc: Remove diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc index 91e53a8b360..4ed1e249013 100644 --- a/libstdc++-v3/libsupc++/new_opa.cc +++ b/libstdc++-v3/libsupc++/new_opa.cc @@ -48,7 +48,11 @@ aligned_alloc (std::size_t al, std::size_t sz) return nullptr; } #elif _GLIBCXX_HAVE_MEMALIGN +#if _GLIBCXX_HOSTED #include +#else +extern "C" void *memalign(std::size_t boundary, std::size_t size); +#endif #define aligned_alloc memalign #else // The C library doesn't provide any aligned allocation functions, declare