On Mon, May 13, 2013 at 11:03 AM, İsmail Dönmez <ismail at donmez.ws> wrote:> Hi, > > > On Mon, May 13, 2013 at 10:49 AM, Evgeniy Stepanov > <eugeni.stepanov at gmail.com> wrote: >> >> A recent change added defined(__linux__) condition to the code below. >> Now it says that on linux with --std=c++0x (or --std=c++11) the system >> stdlib.h header must define aligned_alloc(). Really? >> >> include/__config: >> >> #if ( defined(__FreeBSD__) || defined(__linux__) ) && (__ISO_C_VISIBLE >> >= 2011 || __cplusplus >= 201103L) >> #define _LIBCPP_HAS_QUICK_EXIT >> #define _LIBCPP_HAS_C11_FEATURES >> #endif >> > > I added that line since libc on linux defines at_quick_exit. > > >> >> >> include/cstdlib: >> >> #include <__config> >> #include <stdlib.h> >> #ifdef _LIBCPP_HAS_C11_FEATURES >> using ::aligned_alloc; >> #endif > > > And yes my stdlib.h has > > /usr/include/stdlib.h:extern void *aligned_alloc (size_t __alignment, size_t > __size) > > I am guessing you are running on this on an old system. My glibc version is > 2.17Yes. Ubuntu 12.04 LTS with glibc 2.15 does not have aligned_alloc.
Hi, On Mon, May 13, 2013 at 11:07 AM, Evgeniy Stepanov < eugeni.stepanov at gmail.com> wrote:> On Mon, May 13, 2013 at 11:03 AM, İsmail Dönmez <ismail at donmez.ws> wrote: > > I am guessing you are running on this on an old system. My glibc version > is > > 2.17 > > Yes. Ubuntu 12.04 LTS with glibc 2.15 does not have aligned_alloc. >Then I guess we'll somehow need a glibc version check or something. Not sure how to do it atm. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130513/d205e46b/attachment.html>
You can use #if __GLIBC_PREREQ(2, 17) On Mon, May 13, 2013 at 1:13 PM, İsmail Dönmez <ismail at donmez.ws> wrote:> Hi, > > > On Mon, May 13, 2013 at 11:07 AM, Evgeniy Stepanov < > eugeni.stepanov at gmail.com> wrote: > >> On Mon, May 13, 2013 at 11:03 AM, İsmail Dönmez <ismail at donmez.ws> wrote: >> > I am guessing you are running on this on an old system. My glibc >> version is >> > 2.17 >> >> Yes. Ubuntu 12.04 LTS with glibc 2.15 does not have aligned_alloc. >> > > Then I guess we'll somehow need a glibc version check or something. Not > sure how to do it atm. > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130513/ba952394/attachment.html>