]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/msvcrt.h
file I forgot to commit with other "filedlg.h"s
[wxWidgets.git] / include / wx / msw / msvcrt.h
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
10 // Licence: wxWindows license
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
22 // use debug CRT functions for memory leak detections in VC++ if we're not
23 // using wxWindows own methods
24 #if defined(__WXDEBUG__) && defined(_MSC_VER) && !wxUSE_GLOBAL_MEMORY_OPERATORS && !defined(__NO_VC_CRTDBG__)
25 #define wxUSE_VC_CRTDBG
26 #else
27 #undef wxUSE_VC_CRTDBG
28 #endif
29
30 #ifdef wxUSE_VC_CRTDBG
31 // VC++ uses this macro as debug/release mode indicator
32 #ifndef _DEBUG
33 #define _DEBUG
34 #endif
35
36 // Need to undef new if including crtdbg.h which redefines new itself
37 #ifdef new
38 #undef new
39 #endif
40
41 #include <crtdbg.h>
42
43 #define wxCrtSetDbgFlag(flag) \
44 _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | (flag))
45 #else // !using VC CRT
46 #define wxCrtSetDbgFlag(flag)
47 #endif // wxUSE_VC_CRTDBG
48
49 #endif // _MSW_MSVCRT_H_