1 | /*
|
---|
2 | * Debug API
|
---|
3 | *
|
---|
4 | * Copyright 2001 Francois Gouget.
|
---|
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 |
|
---|
21 | /*
|
---|
22 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __WINE_CRTDBG_H_
|
---|
31 | #define __WINE_CRTDBG_H_
|
---|
32 |
|
---|
33 | #include <crtdefs.h>
|
---|
34 |
|
---|
35 | /* The debug API is not implemented in Winelib.
|
---|
36 | * Redirect everything to the regular APIs.
|
---|
37 | */
|
---|
38 |
|
---|
39 | #define _CRT_WARN 0
|
---|
40 | #define _CRT_ERROR 1
|
---|
41 | #define _CRT_ASSERT 2
|
---|
42 | #define _CRT_ERRCNT 3
|
---|
43 |
|
---|
44 | #define _FREE_BLOCK 0
|
---|
45 | #define _NORMAL_BLOCK 1
|
---|
46 | #define _CRT_BLOCK 2
|
---|
47 | #define _IGNORE_BLOCK 3
|
---|
48 | #define _CLIENT_BLOCK 4
|
---|
49 | #define _MAX_BLOCKS 5
|
---|
50 |
|
---|
51 | #define _BLOCK_TYPE(block) (block & 0xFFFF)
|
---|
52 | #define _BLOCK_SUBTYPE(block) (block >> 16 & 0xFFFF)
|
---|
53 |
|
---|
54 | typedef struct _CrtMemState
|
---|
55 | {
|
---|
56 | struct _CrtMemBlockHeader* pBlockHeader;
|
---|
57 | __msvcrt_ulong lCounts[_MAX_BLOCKS];
|
---|
58 | __msvcrt_ulong lSizes[_MAX_BLOCKS];
|
---|
59 | __msvcrt_ulong lHighWaterCount;
|
---|
60 | __msvcrt_ulong lTotalCount;
|
---|
61 | } _CrtMemState;
|
---|
62 |
|
---|
63 |
|
---|
64 | #ifndef _DEBUG
|
---|
65 |
|
---|
66 | #define _ASSERT(expr) ((void)0)
|
---|
67 | #define _ASSERTE(expr) ((void)0)
|
---|
68 | #define _CrtDbgBreak() ((void)0)
|
---|
69 |
|
---|
70 | #define _CrtCheckMemory() ((int)1)
|
---|
71 | #define _CrtDbgReport(...) ((int)0)
|
---|
72 | #define _CrtDumpMemoryLeaks() ((int)0)
|
---|
73 | #define _CrtSetBreakAlloc(a) ((__msvcrt_long)0)
|
---|
74 | #define _CrtSetDbgFlag(f) ((int)0)
|
---|
75 | #define _CrtSetDumpClient(f) ((void)0)
|
---|
76 | #define _CrtSetReportMode(t,m) ((int)0)
|
---|
77 |
|
---|
78 | #else /* _DEBUG */
|
---|
79 |
|
---|
80 | #include <assert.h>
|
---|
81 | #define _ASSERT(expr) assert(expr)
|
---|
82 | #define _ASSERTE(expr) assert(expr)
|
---|
83 | #if defined(__GNUC__) && defined(__i386__)
|
---|
84 | #define _CrtDbgBreak() __asm__ ("\tint $0x3\n")
|
---|
85 | #else
|
---|
86 | #define _CrtDbgBreak() ((void)0)
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | #ifdef __cplusplus
|
---|
90 | extern "C" {
|
---|
91 | #endif
|
---|
92 |
|
---|
93 | extern int _crtAssertBusy;
|
---|
94 | extern int _crtBreakAlloc;
|
---|
95 | extern int _crtDbgFlag;
|
---|
96 |
|
---|
97 | int __cdecl _CrtCheckMemory(void);
|
---|
98 | int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber,
|
---|
99 | const char *moduleName, const char *format, ...);
|
---|
100 | int __cdecl _CrtDumpMemoryLeaks(void);
|
---|
101 | int __cdecl _CrtSetBreakAlloc(int);
|
---|
102 | int __cdecl _CrtSetDbgFlag(int);
|
---|
103 | void *__cdecl _CrtSetDumpClient(void *dumpClient);
|
---|
104 | int __cdecl _CrtSetReportMode(int reportType, int reportMode);
|
---|
105 |
|
---|
106 | #ifdef __cplusplus
|
---|
107 | }
|
---|
108 | #endif
|
---|
109 |
|
---|
110 | #endif /* _DEBUG */
|
---|
111 |
|
---|
112 | #define _CrtDoForAllClientObjects(f,c) ((void)0)
|
---|
113 | #define _CrtIsMemoryBlock(p,s,r,f,l) ((int)1)
|
---|
114 | #define _CrtIsValidHeapPointer(p) ((int)1)
|
---|
115 | #define _CrtIsValidPointer(p,s,a) ((int)1)
|
---|
116 | #define _CrtMemCheckpoint(s) ((void)0)
|
---|
117 | #define _CrtMemDifference(s1,s2,s3) ((int)0)
|
---|
118 | #define _CrtMemDumpAllObjectsSince(s) ((void)0)
|
---|
119 | #define _CrtMemDumpStatistics(s) ((void)0)
|
---|
120 | #define _CrtSetAllocHook(f) ((void)0)
|
---|
121 |
|
---|
122 | #define _RPT0(t,m)
|
---|
123 | #define _RPT1(t,m,p1)
|
---|
124 | #define _RPT2(t,m,p1,p2)
|
---|
125 | #define _RPT3(t,m,p1,p2,p3)
|
---|
126 | #define _RPT4(t,m,p1,p2,p3,p4)
|
---|
127 | #define _RPTF0(t,m)
|
---|
128 | #define _RPTF1(t,m,p1)
|
---|
129 | #define _RPTF2(t,m,p1,p2)
|
---|
130 | #define _RPTF3(t,m,p1,p2,p3)
|
---|
131 | #define _RPTF4(t,m,p1,p2,p3,p4)
|
---|
132 |
|
---|
133 |
|
---|
134 | #define _malloc_dbg(s,t,f,l) malloc(s)
|
---|
135 | #define _calloc_dbg(c,s,t,f,l) calloc(c,s)
|
---|
136 | #define _expand_dbg(p,s,t,f,l) _expand(p,s)
|
---|
137 | #define _free_dbg(p,t) free(p)
|
---|
138 | #define _realloc_dbg(p,s,t,f,l) realloc(p,s)
|
---|
139 |
|
---|
140 | #endif /* __WINE_CRTDBG_H */
|
---|