summaryrefslogtreecommitdiffstats
path: root/source/MemoryLeak.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-27 15:04:28 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-27 15:04:28 +0100
commit86158a2d1de4594664c80d76d153fe4284d50703 (patch)
treea569eaf353095234b95f8394cfeb326d0bfc31ac /source/MemoryLeak.h
parentResources: Added MSVC2008 Express compatibility (no MFC referenced in the resource script) (diff)
downloadcuberite-86158a2d1de4594664c80d76d153fe4284d50703.tar
cuberite-86158a2d1de4594664c80d76d153fe4284d50703.tar.gz
cuberite-86158a2d1de4594664c80d76d153fe4284d50703.tar.bz2
cuberite-86158a2d1de4594664c80d76d153fe4284d50703.tar.lz
cuberite-86158a2d1de4594664c80d76d153fe4284d50703.tar.xz
cuberite-86158a2d1de4594664c80d76d153fe4284d50703.tar.zst
cuberite-86158a2d1de4594664c80d76d153fe4284d50703.zip
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