]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Use abort() if _HAS_EXCEPTIONS is not defined.
authorAlec Thomas <alec@swapoff.org>
Wed, 13 Aug 2014 22:38:01 +0000 (08:38 +1000)
committerAlec Thomas <alec@swapoff.org>
Wed, 13 Aug 2014 22:56:33 +0000 (08:56 +1000)
entityx/Entity.h

index e30f87e6a5e5a44da0e789e0ff976fd43718c6f4..c56b37de8268d88f2e306317af37558c18f7bde6 100644 (file)
@@ -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: