From 999fc97ef22969aa73f06bf9aa7dfee4f0eef219 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 13 Oct 2012 18:03:53 +0000 Subject: [PATCH] Dimitry Andric: FreeBSD only: Add the C11 aligned_alloc to and adjust the inclusion of quick_exit. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@165882 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 3 ++- include/cstdlib | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/__config b/include/__config index 189140f07..75b2206f2 100644 --- a/include/__config +++ b/include/__config @@ -252,8 +252,9 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_CONSTEXPR #endif -#if __FreeBSD__ +#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) #define _LIBCPP_HAS_QUICK_EXIT +#define _LIBCPP_HAS_C11_FEATURES #endif #if (__has_feature(cxx_noexcept)) diff --git a/include/cstdlib b/include/cstdlib index bf8e85e7b..7f6c6c82f 100644 --- a/include/cstdlib +++ b/include/cstdlib @@ -74,6 +74,9 @@ int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n); int wctomb(char* s, wchar_t wchar); size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n); size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); +int at_quick_exit(void (*func)(void)) // C++11 +void quick_exit(int status); // C++11 +void *aligned_alloc(size_t alignment, size_t size); // C11 } // std @@ -135,6 +138,9 @@ using ::wcstombs; using ::at_quick_exit; using ::quick_exit; #endif +#ifdef _LIBCPP_HAS_C11_FEATURES +using ::aligned_alloc; +#endif // MSVC already has the correct prototype in #ifdef __cplusplus #if !defined(_MSC_VER) && !defined(__sun__)