| 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 19 | */
|
|---|
| 20 | #ifndef __WINE_CRTDBG_H_
|
|---|
| 21 | #define __WINE_CRTDBG_H_
|
|---|
| 22 | #define __WINE_USE_MSVCRT
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | /* The debug API is not implemented in Winelib.
|
|---|
| 26 | * Redirect everything to the regular APIs.
|
|---|
| 27 | */
|
|---|
| 28 |
|
|---|
| 29 | #define _CRT_WARN 0
|
|---|
| 30 | #define _CRT_ERROR 1
|
|---|
| 31 | #define _CRT_ASSERT 2
|
|---|
| 32 | #define _CRT_ERRCNT 3
|
|---|
| 33 |
|
|---|
| 34 | #define _FREE_BLOCK 0
|
|---|
| 35 | #define _NORMAL_BLOCK 1
|
|---|
| 36 | #define _CRT_BLOCK 2
|
|---|
| 37 | #define _IGNORE_BLOCK 3
|
|---|
| 38 | #define _CLIENT_BLOCK 4
|
|---|
| 39 | #define _MAX_BLOCKS 5
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 | typedef struct _CrtMemState
|
|---|
| 43 | {
|
|---|
| 44 | struct _CrtMemBlockHeader* pBlockHeader;
|
|---|
| 45 | unsigned long lCounts[_MAX_BLOCKS];
|
|---|
| 46 | unsigned long lSizes[_MAX_BLOCKS];
|
|---|
| 47 | unsigned long lHighWaterCount;
|
|---|
| 48 | unsigned long lTotalCount;
|
|---|
| 49 | } _CrtMemState;
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | #ifndef _DEBUG
|
|---|
| 53 |
|
|---|
| 54 | #define _ASSERT(expr) (0)
|
|---|
| 55 | #define _ASSERTE(expr) (0)
|
|---|
| 56 | #define _CrtDbgBreak() (0)
|
|---|
| 57 |
|
|---|
| 58 | #else /* _DEBUG */
|
|---|
| 59 |
|
|---|
| 60 | #include <assert.h>
|
|---|
| 61 | #define _ASSERT(expr) assert(expr)
|
|---|
| 62 | #define _ASSERTE(expr) assert(expr)
|
|---|
| 63 | #if defined(__GNUC__) && defined(__i386__)
|
|---|
| 64 | #define _CrtDbgBreak() __asm__ ("\tint $0x3\n")
|
|---|
| 65 | #else
|
|---|
| 66 | #define _CrtDbgBreak() (0)
|
|---|
| 67 | #endif
|
|---|
| 68 |
|
|---|
| 69 | #endif /* _DEBUG */
|
|---|
| 70 |
|
|---|
| 71 | #define _CrtCheckMemory() (1)
|
|---|
| 72 | #define _CrtDbgReport(...) (0)
|
|---|
| 73 | #define _CrtDoForAllClientObjects(f,c) (0)
|
|---|
| 74 | #define _CrtDumpMemoryLeaks() (0)
|
|---|
| 75 | #define _CrtIsMemoryBlock(p,s,r,f,l) (1)
|
|---|
| 76 | #define _CrtIsValidHeapPointer(p) (1)
|
|---|
| 77 | #define _CrtIsValidPointer(p,s,a) (1)
|
|---|
| 78 | #define _CrtMemCheckpoint(s) (0)
|
|---|
| 79 | #define _CrtMemDifference(s1,s2,s3) (0)
|
|---|
| 80 | #define _CrtMemDumpAllObjectsSince(s) (0)
|
|---|
| 81 | #define _CrtMemDumpStatistics(s) (0)
|
|---|
| 82 | #define _CrtSetAllocHook(f) (0)
|
|---|
| 83 | #define _CrtSetBreakAlloc(a) (0)
|
|---|
| 84 | #define _CrtSetDbgFlag(f) (0)
|
|---|
| 85 | #define _CrtSetDumpClient(f) (0)
|
|---|
| 86 | #define _CrtSetReportMode(t,m) (0)
|
|---|
| 87 |
|
|---|
| 88 | #define _RPT0(t,m)
|
|---|
| 89 | #define _RPT1(t,m,p1)
|
|---|
| 90 | #define _RPT2(t,m,p1,p2)
|
|---|
| 91 | #define _RPT3(t,m,p1,p2,p3)
|
|---|
| 92 | #define _RPT4(t,m,p1,p2,p3,p4)
|
|---|
| 93 | #define _RPTF0(t,m)
|
|---|
| 94 | #define _RPTF1(t,m,p1)
|
|---|
| 95 | #define _RPTF2(t,m,p1,p2)
|
|---|
| 96 | #define _RPTF3(t,m,p1,p2,p3)
|
|---|
| 97 | #define _RPTF4(t,m,p1,p2,p3,p4)
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 | #define _malloc_dbg(s,t,f,l) malloc(s)
|
|---|
| 101 | #define _calloc_dbg(c,s,t,f,l) calloc(c,s)
|
|---|
| 102 | #define _expand_dbg(p,s,t,f,l) _expand(p,s)
|
|---|
| 103 | #define _free_dbg(p,t) free(p)
|
|---|
| 104 | #define _realloc_dbg(p,s,t,f,l) realloc(p,s)
|
|---|
| 105 |
|
|---|
| 106 | #endif /* __WINE_CRTDBG_H */
|
|---|