Message ID | HE1PR0701MB2169313C5EA68794991DAD09E4AB0@HE1PR0701MB2169.eurprd07.prod.outlook.com |
---|---|
State | New |
Headers | show |
On 26/10/16 16:26 +0000, Bernd Edlinger wrote: > * libsupc++/new_opa.cc: Don't include <malloc.h> in a free standing > environmnet. Declare memalign directly in that case. Typo "environmnet". OK for trunk, thanks. We might actually want to avoid <malloc.h> in other cases, as some systems have a #warning in <malloc.h> saying it's deprecated ... although they probably have aligned_alloc or posix_memalign anyway so we won't try to use memalign.
2016-10-26 Bernd Edlinger <bernd.edlinger@hotmail.de> * libsupc++/new_opa.cc: Don't include <malloc.h> in a free standing environmnet. Declare memalign directly in that case. --- libstdc++-v3/libsupc++/new_opa.cc.orig 2016-09-16 20:09:14.000000000 +0200 +++ libstdc++-v3/libsupc++/new_opa.cc 2016-10-26 09:40:41.722542566 +0200 @@ -48,7 +48,11 @@ return nullptr; } #elif _GLIBCXX_HAVE_MEMALIGN +#if _GLIBCXX_HOSTED #include <malloc.h> +#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