aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Thomas <alec@swapoff.org>2014-08-14 08:38:01 +1000
committerAlec Thomas <alec@swapoff.org>2014-08-14 08:56:33 +1000
commit17b51d775875c9eea7313d70764623250c941870 (patch)
tree026a408f0bc9f2b72cce5a9a4b60b2b66e95e7df
parent955f9422d8646e1f6b1c22bdc0a40f59a34ae0a8 (diff)
Use abort() if _HAS_EXCEPTIONS is not defined.
-rw-r--r--entityx/Entity.h17
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: