summaryrefslogtreecommitdiffstats
path: root/source/MemoryLeak.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/MemoryLeak.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/source/MemoryLeak.h b/source/MemoryLeak.h
index 6ac06a302..a7f0c316b 100644
--- a/source/MemoryLeak.h
+++ b/source/MemoryLeak.h
@@ -1,18 +1,19 @@
#pragma once
#ifdef _WIN32
-
-#ifdef _DEBUG
-
-#define _CRTDBG_MAP_ALLOC
-#include <stdlib.h>
-#include <crtdbg.h>
-
-#ifndef DEBUG_NEW
-#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
-#define new DEBUG_NEW
-#endif
-
-#endif
-
-#endif
+ #ifdef _DEBUG
+ // Enable the CRT debugging features:
+ #define _CRTDBG_MAP_ALLOC
+ #include <stdlib.h>
+ #include <crtdbg.h>
+
+ // This works only in MSVC 2010+:
+ #if _MSC_VER >= 1600
+ // Map the new operator
+ #ifndef DEBUG_NEW
+ #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
+ #define new DEBUG_NEW
+ #endif // _CRTDBG_MAP_ALLOC
+ #endif // _MSC_VER
+ #endif // _DEBUG
+#endif // _WIN32