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