diff options
author | Alec Thomas <alec@swapoff.org> | 2014-08-14 08:38:01 +1000 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2014-08-14 08:56:33 +1000 |
commit | 17b51d775875c9eea7313d70764623250c941870 (patch) | |
tree | 026a408f0bc9f2b72cce5a9a4b60b2b66e95e7df | |
parent | 955f9422d8646e1f6b1c22bdc0a40f59a34ae0a8 (diff) |
Use abort() if _HAS_EXCEPTIONS is not defined.
-rw-r--r-- | entityx/Entity.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/entityx/Entity.h b/entityx/Entity.h index e30f87e..c56b37d 100644 --- a/entityx/Entity.h +++ b/entityx/Entity.h @@ -220,8 +220,21 @@ struct BaseComponent { // NOTE: Component memory is *always* managed by the EntityManager. // Use Entity::destroy() instead. - void operator delete(void *p) { throw std::bad_alloc(); } - void operator delete[](void *p) { throw std::bad_alloc(); } + void operator delete(void *p) { +#ifdef _HAS_EXCEPTIONS + throw std::bad_alloc(); +#else + abort(); +#endif + } + + void operator delete[](void *p) { +#ifdef _HAS_EXCEPTIONS + throw std::bad_alloc(); +#else + abort(); +#endif + } protected: |