fixed compilation errors when DEBUG is switched on
[deliverable/titan.core.git] / common / dbgnew.hh
index c3164531bcbc7c5163125c7392dd3697d5292eb7..2f9ddbb6a48dbab92b3d9641f935849722e9f029 100644 (file)
@@ -19,6 +19,8 @@
 
 #ifdef MEMORY_DEBUG
 
+#include <new>
+
 class debug_new_counter_t
 {
   static int count;
@@ -40,8 +42,15 @@ static debug_new_counter_t debug_new_counter;
 void* operator new(size_t size, const char* file, int line);
 void* operator new[](size_t size, const char* file, int line);
 
+// TODO: these might be GCC version dependant
+void* operator new(size_t size, const std::nothrow_t&, const char* file, int line);
+void* operator new[](size_t size, const std::nothrow_t&, const char* file, int line);
+
+inline void* operator new(size_t, void* __p, const char*, int) { return __p; }
+inline void* operator new[](size_t, void* __p, const char*, int) { return __p; }
+
 // Redirect "normal" new to memory-tracking placement new.
-#define new new(__FILE__, __LINE__)
+#define new(...) new(__VA_ARGS__, __FILE__, __LINE__)
 
 #endif // MEMORY_DEBUG
 
This page took 0.028832 seconds and 5 git commands to generate.