2007-08-01 12:04:49 +00:00
|
|
|
#ifdef _DEBUG_MEM
|
2007-08-01 10:17:13 +00:00
|
|
|
|
|
|
|
#define cmd_alloc(size) cmd_alloc_dbg(size, __FILE__, __LINE__)
|
|
|
|
#define cmd_realloc(ptr,size) cmd_realloc_dbg(ptr, size, __FILE__, __LINE__)
|
|
|
|
#define cmd_free(ptr) cmd_free_dbg(ptr, __FILE__, __LINE__)
|
2007-08-01 12:04:49 +00:00
|
|
|
#define cmd_checkbuffer(ptr) cmd_checkbuffer_dbg(ptr, __FILE__, __LINE__)
|
2007-10-27 03:13:37 +00:00
|
|
|
#define cmd_dup(str) cmd_dup_dbg(str, __FILE__, __LINE__)
|
2007-08-01 10:17:13 +00:00
|
|
|
|
|
|
|
void *
|
|
|
|
cmd_alloc_dbg(size_t size, const char *file, int line);
|
|
|
|
|
|
|
|
void *
|
|
|
|
cmd_realloc_dbg(void *ptr, size_t size, const char *file, int line);
|
|
|
|
|
|
|
|
void
|
|
|
|
cmd_free_dbg(void *ptr, const char *file, int line);
|
|
|
|
|
2007-10-27 03:13:37 +00:00
|
|
|
TCHAR *
|
|
|
|
cmd_dup_dbg(const TCHAR *str, const char *file, int line);
|
|
|
|
|
2007-08-01 12:04:49 +00:00
|
|
|
void
|
|
|
|
cmd_checkbuffer_dbg(void *ptr, const char *file, int line);
|
|
|
|
|
2007-08-01 12:34:49 +00:00
|
|
|
void
|
|
|
|
cmd_exit(int code);
|
|
|
|
|
2007-08-01 10:17:13 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
#define cmd_alloc(size) malloc(size)
|
|
|
|
#define cmd_realloc(ptr,size) realloc(ptr, size)
|
|
|
|
#define cmd_free(ptr) free(ptr)
|
2007-10-27 03:13:37 +00:00
|
|
|
#define cmd_dup(str) _tcsdup(str)
|
2007-08-01 12:04:49 +00:00
|
|
|
#define cmd_checkbuffer(ptr)
|
2008-05-17 08:49:39 +00:00
|
|
|
#define cmd_exit(code) ExitProcess(code)
|
2007-08-01 10:17:13 +00:00
|
|
|
|
|
|
|
#endif
|