Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / include / vld / vld.h
blobffe675d7d7947db23076a2ffcf55c173d8265ce1
1 ////////////////////////////////////////////////////////////////////////////////
2 // $Id: vld.h,v 1.27 2006/11/12 18:09:20 dmouldin Exp $
3 //
4 // Visual Leak Detector (Version 1.9d) - Import Library Header
5 // Copyright (c) 2006 Dan Moulding
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 // See COPYING.txt for the full terms of the GNU Lesser General Public License.
23 ////////////////////////////////////////////////////////////////////////////////
25 //#pragma once
26 #ifndef _VLD_H_
27 #define _VLD_H_
29 #ifdef _DEBUG
31 #pragma comment(lib, "vld.lib")
33 // Force a symbolic reference to the global VisualLeakDetector class object from
34 // the DLL. This enusres that the DLL is loaded and linked with the program,
35 // even if no code otherwise imports any of the DLL's exports.
36 #pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A")
38 ////////////////////////////////////////////////////////////////////////////////
40 // Visual Leak Detector APIs
43 #ifdef __cplusplus
44 extern "C" {
45 #endif // __cplusplus
47 // VLDDisable - Disables Visual Leak Detector's memory leak detection at
48 // runtime. If memory leak detection is already disabled, then calling this
49 // function has no effect.
51 // Note: In multithreaded programs, this function operates on a per-thread
52 // basis. In other words, if you call this function from one thread, then
53 // memory leak detection is only disabled for that thread. If memory leak
54 // detection is enabled for other threads, then it will remain enabled for
55 // those other threads. It was designed to work this way to insulate you,
56 // the programmer, from having to ensure thread synchronization when calling
57 // VLDEnable() and VLDDisable(). Without this, calling these two functions
58 // unsychronized could result in unpredictable and unintended behavior.
59 // But this also means that if you want to disable memory leak detection
60 // process-wide, then you need to call this function from every thread in
61 // the process.
63 // Return Value:
65 // None.
68 __declspec(dllimport) void VLDDisable ();
70 // VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime.
71 // If memory leak detection is already enabled, which it is by default, then
72 // calling this function has no effect.
74 // Note: In multithreaded programs, this function operates on a per-thread
75 // basis. In other words, if you call this function from one thread, then
76 // memory leak detection is only enabled for that thread. If memory leak
77 // detection is disabled for other threads, then it will remain disabled for
78 // those other threads. It was designed to work this way to insulate you,
79 // the programmer, from having to ensure thread synchronization when calling
80 // VLDEnable() and VLDDisable(). Without this, calling these two functions
81 // unsychronized could result in unpredictable and unintended behavior.
82 // But this also means that if you want to enable memory leak detection
83 // process-wide, then you need to call this function from every thread in
84 // the process.
86 // Return Value:
88 // None.
91 __declspec(dllimport) void VLDEnable ();
93 #ifdef __cplusplus
95 #endif // __cplusplus
97 #else // !_DEBUG
99 #define VLDEnable()
100 #define VLDDisable()
102 #endif // _DEBUG
104 #endif // _VLD_H_