1 From cc35f95a952b52b0f9c5291c3bb044161e21d7b6 Mon Sep 17 00:00:00 2001 2 From: David 'Digit' Turner <digit (a] google.com> 3 Date: Thu, 2 May 2013 14:11:53 +0200 4 Subject: src/new.cpp: Support building with GAbi++ 5 6 --- 7 src/new.cpp | 12 ++++++++---- 8 1 file changed, 8 insertions(+), 4 deletions(-) 9 10 diff --git a/src/new.cpp b/src/new.cpp 11 index b23a516..cf1d3c0 100644 12 --- a/src/new.cpp 13 +++ b/src/new.cpp 14 @@ -144,15 +144,19 @@ operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT 15 namespace std 16 { 17 18 +#ifndef GABIXX_LIBCXX 19 const nothrow_t nothrow = {}; 20 +#endif 21 22 -#ifndef _LIBCPPABI_VERSION 23 +#if !defined(_LIBCPPABI_VERSION) 24 25 +#if !defined(GABIXX_LIBCXX) 26 new_handler 27 set_new_handler(new_handler handler) _NOEXCEPT 28 { 29 return __sync_lock_test_and_set(&__new_handler, handler); 30 } 31 +#endif 32 33 new_handler 34 get_new_handler() _NOEXCEPT 35 @@ -160,7 +164,7 @@ get_new_handler() _NOEXCEPT 36 return __sync_fetch_and_add(&__new_handler, (new_handler)0); 37 } 38 39 -#ifndef LIBCXXRT 40 +#if !defined(LIBCXXRT) 41 42 bad_alloc::bad_alloc() _NOEXCEPT 43 { 44 @@ -176,7 +180,7 @@ bad_alloc::what() const _NOEXCEPT 45 return "std::bad_alloc"; 46 } 47 48 -#endif //LIBCXXRT 49 +#endif // !LIBCXXRT 50 51 bad_array_new_length::bad_array_new_length() _NOEXCEPT 52 { 53 @@ -192,7 +196,7 @@ bad_array_new_length::what() const _NOEXCEPT 54 return "bad_array_new_length"; 55 } 56 57 -#endif 58 +#endif // !_LIBCPPABI_VERSION && !GABIXX_LIBCXX 59 60 void 61 __throw_bad_alloc() 62 -- 63 1.7.12.146.g16d26b1 64 65