| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#if defined _WIN32 |
| 7 |
|
| 8 |
|
| 9 |
#define CHECK_HEAP_INTEGRITY() |
| 10 |
|
| 11 |
|
| 12 |
#if defined(_DEBUG) |
| 13 |
#include <crtdbg.h> |
| 14 |
#undef CHECK_HEAP_INTEGRITY |
| 15 |
#define CHECK_HEAP_INTEGRITY() \ |
| 16 |
{ \ |
| 17 |
if (!_CrtCheckMemory()) \ |
| 18 |
PanicAlertFmt("memory corruption detected. see log."); \ |
| 19 |
} |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
struct CrtDebugBreak |
| 24 |
{ |
| 25 |
CrtDebugBreak(int spot) { _CrtSetBreakAlloc(spot); } |
| 26 |
}; |
| 27 |
|
| 28 |
#endif |
| 29 |
|
| 30 |
#endif |
| 31 |
|
| 32 |
#ifdef _MSC_VER |
| 33 |
#define __getcwd _getcwd |
| 34 |
#define __chdir _chdir |
| 35 |
#else |
| 36 |
#define __getcwd getcwd |
| 37 |
#define __chdir chdir |
| 38 |
#endif |
| 39 |
|
| 40 |
|
| 41 |
#define _trans(a) a |