From: Alec Thomas Date: Wed, 13 Aug 2014 22:38:01 +0000 (+1000) Subject: Use abort() if _HAS_EXCEPTIONS is not defined. X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=17b51d775875c9eea7313d70764623250c941870;p=clyne%2Fentityx.git Use abort() if _HAS_EXCEPTIONS is not defined. --- 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: