diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-01-10 17:32:51 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-01-13 17:59:15 +0700 |
commit | 44cb63a6ecea58dc21d20843f5af0a006f8b36cd (patch) | |
tree | 61b12af6826f796ec43c12a8ff3dfbf5fa98f1a7 /system/lib/libcxxabi/src/cxa_new_delete.cpp | |
parent | 88d2ba5490b515245143e125b5ae52e27c2ee78c (diff) |
Update to current libcxxabi for new exception code.
Diffstat (limited to 'system/lib/libcxxabi/src/cxa_new_delete.cpp')
-rw-r--r-- | system/lib/libcxxabi/src/cxa_new_delete.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/system/lib/libcxxabi/src/cxa_new_delete.cpp b/system/lib/libcxxabi/src/cxa_new_delete.cpp index 7fd0b3b7..25a5454e 100644 --- a/system/lib/libcxxabi/src/cxa_new_delete.cpp +++ b/system/lib/libcxxabi/src/cxa_new_delete.cpp @@ -9,6 +9,8 @@ // This file implements the new and delete operators. //===----------------------------------------------------------------------===// +#define _LIBCPP_BUILDING_NEW + #include <new> #include <cstdlib> @@ -228,15 +230,33 @@ bad_array_new_length::what() const _NOEXCEPT return "bad_array_new_length"; } -#ifdef __EMSCRIPTEN__ -// We don't build the new.cpp from libcxx, so we need to define this. -void -__throw_bad_alloc() +// bad_array_length + +#ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED + +class _LIBCPP_EXCEPTION_ABI bad_array_length + : public bad_alloc +{ +public: + bad_array_length() _NOEXCEPT; + virtual ~bad_array_length() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; +}; + +#endif // _LIBCPP_BAD_ARRAY_LENGTH_DEFINED + +bad_array_length::bad_array_length() _NOEXCEPT { -#ifndef _LIBCPP_NO_EXCEPTIONS - throw bad_alloc(); -#endif } -#endif + +bad_array_length::~bad_array_length() _NOEXCEPT +{ +} + +const char* +bad_array_length::what() const _NOEXCEPT +{ + return "bad_array_length"; +} } // std |