On Thu, Aug 18, 2022 at 10:38:38PM -0400, Brad Smith wrote: > While trying to update to the latest MariaDB release I ran into an issue > with the stdlib.h header where it does not expose aligned_alloc() in C++11 > mode breaking the build. Looking around this was fixed in FreeBSD, NetBSD > and DragonFly years ago. > > https://github.com/freebsd/freebsd-src/commit/79d09835dd3c33a699b00d00ec50be6a4512b57f
It does not appear in the standard drafts until c++17 llvm cstdlib also has #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_ALIGNED_ALLOC) using ::aligned_alloc _LIBCPP_USING_IF_EXISTS; #endif > > > Index: stdlib.h > =================================================================== > RCS file: /home/cvs/src/include/stdlib.h,v > retrieving revision 1.76 > diff -u -p -u -p -r1.76 stdlib.h > --- stdlib.h 10 May 2019 15:03:24 -0000 1.76 > +++ stdlib.h 16 Aug 2022 22:55:41 -0000 > @@ -223,7 +223,7 @@ unsigned long long > strtoull(const char *__restrict, char **__restrict, int); > #endif > > -#if __ISO_C_VISIBLE >= 2011 > +#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103 > void * > aligned_alloc(size_t, size_t); > #endif > >