From 86158a2d1de4594664c80d76d153fe4284d50703 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 27 Jan 2012 14:04:28 +0000 Subject: MSVC 2008 Express compatibility: Added the projects, modified sources to compile. Tested on MSVC 2008 Express and MSVC 2010 Express git-svn-id: http://mc-server.googlecode.com/svn/trunk@179 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/MemoryLeak.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'source/MemoryLeak.h') 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 -#include - -#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 + #include + + // 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 -- cgit v1.2.3