]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/msvcrt.h
added wxListCtrl::SetItemPtrData()
[wxWidgets.git] / include / wx / msw / msvcrt.h
CommitLineData
6e0d9d43
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/msw/msvcrt.h
3// Purpose: macros to use some non-standard features of MS Visual C++
4// C run-time library
5// Author: Vadim Zeitlin
6// Modified by:
7// Created: 31.01.1999
8// RCS-ID: $Id$
9// Copyright: (c) Vadim Zeitlin
65571936 10// Licence: wxWindows licence
6e0d9d43
VZ
11/////////////////////////////////////////////////////////////////////////////
12
13// the goal of this file is to define wxCrtSetDbgFlag() macro which may be
14// used like this:
15// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
16// to turn on memory leak checks for programs compiled with Microsoft Visual
17// C++ (5.0+). The macro will expand to nothing under other compilers.
18
19#ifndef _MSW_MSVCRT_H_
20#define _MSW_MSVCRT_H_
21
3f4a0c5b
VZ
22// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug
23// builds
24#undef wxUSE_VC_CRTDBG
0c2d809a
VS
25#if defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \
26 && !defined(UNDER_CE)
3f4a0c5b 27 // it doesn't combine well with wxWin own memory debugging methods
5d06f362 28 #if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__)
3f4a0c5b
VZ
29 #define wxUSE_VC_CRTDBG
30 #endif
6e0d9d43
VZ
31#endif
32
33#ifdef wxUSE_VC_CRTDBG
34 // VC++ uses this macro as debug/release mode indicator
35 #ifndef _DEBUG
36 #define _DEBUG
37 #endif
38
0afb5852 39 // Need to undef new if including crtdbg.h which may redefine new itself
6e0d9d43
VZ
40 #ifdef new
41 #undef new
42 #endif
43
b321fb12 44 #include <stdlib.h>
7f0da369
JS
45 #ifndef _CRTBLD
46 // Need when builded with pure MS SDK
47 #define _CRTBLD
48 #endif
49
6e0d9d43
VZ
50 #include <crtdbg.h>
51
70bf6180
VZ
52 #undef WXDEBUG_NEW
53 #define WXDEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
54
b321fb12
VZ
55 // this define works around a bug with inline declarations of new, see
56 //
57 // http://support.microsoft.com/support/kb/articles/Q140/8/58.asp
58 //
0afb5852 59 // for the details
70bf6180 60 #define new WXDEBUG_NEW
b321fb12 61
6e0d9d43
VZ
62 #define wxCrtSetDbgFlag(flag) \
63 _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | (flag))
64#else // !using VC CRT
65 #define wxCrtSetDbgFlag(flag)
66#endif // wxUSE_VC_CRTDBG
67
3f4a0c5b
VZ
68#endif // _MSW_MSVCRT_H_
69