66#if !defined (DEVELOPMENT) && !defined (RELEASE)
69 #elif defined (NDEBUG)
72 #error DEVELOPMENT, RELEASE, _DEBUG, or NDEBUG must be defined!
82#if DEVELOPMENT && defined(_MSC_VER)
83#pragma warning(disable : 4291)
84#pragma warning(disable : 4985)
96#define SMTG_ASSERT(f) \
98 FDebugBreak ("%s(%d) : Assert failed: %s\n", __FILE__, __LINE__, #f);
101#define SMTG_WARNING(comment) FDebugPrint ("%s(%d) : %s\n", __FILE__, __LINE__, comment);
104#define SMTG_PRINTSYSERROR FPrintLastError (__FILE__, __LINE__);
108#define SMTG_DEBUGSTR(s) FDebugBreak (s);
113#define SMTG_VERIFY(f) SMTG_ASSERT (f)
118#define SMTG_VERIFY_IS(f, r) \
120 FDebugBreak ("%s(%d) : Assert failed: %s\n", __FILE__, __LINE__, #f);
125#define SMTG_VERIFY_NOT(f, r) \
127 FDebugBreak ("%s(%d) : Assert failed: %s\n", __FILE__, __LINE__, #f);
134#define SMTG_DBPRT0(a) FDebugPrint (a);
135#define SMTG_DBPRT1(a, b) FDebugPrint (a, b);
136#define SMTG_DBPRT2(a, b, c) FDebugPrint (a, b, c);
137#define SMTG_DBPRT3(a, b, c, d) FDebugPrint (a, b, c, d);
138#define SMTG_DBPRT4(a, b, c, d, e) FDebugPrint (a, b, c, d, e);
139#define SMTG_DBPRT5(a, b, c, d, e, f) FDebugPrint (a, b, c, d, e, f);
148void FDebugPrint (
const char*
format, ...);
149void FDebugBreak (
const char*
format, ...);
150void FPrintLastError (
const char*
file,
int line);
158using AssertionHandler = bool (*) (
const char*
message);
159extern AssertionHandler gAssertionHandler;
160extern AssertionHandler gPreAssertionHook;
161using DebugPrintLogger =
void (*) (
const char*
message);
162extern DebugPrintLogger gDebugPrintLogger;
169void*
operator new (size_t,
int,
const char*,
int);
170void*
operator new[] (size_t,
int,
const char*,
int);
171void operator delete (
void*
p,
int,
const char*
file,
int line);
172void operator delete[] (
void*
p,
int,
const char*
file,
int line);
174#define NEW new (1, __FILE__, __LINE__)
175#define NEWVEC new (1, __FILE__, __LINE__)
178#define DEBUG_NEW DEBUG_NEW_LEAKS
180#elif SMTG_OS_WINDOWS && defined(_MSC_VER)
182void*
operator new (size_t,
int,
const char*,
int);
183#define NEW new (1, __FILE__, __LINE__)
184#define NEWVEC new (1, __FILE__, __LINE__)
196#define SMTG_ASSERT(f)
197#define SMTG_WARNING(s)
198#define SMTG_PRINTSYSERROR
199#define SMTG_DEBUGSTR(s)
200#define SMTG_VERIFY(f) f;
201#define SMTG_VERIFY_IS(f, r) f;
202#define SMTG_VERIFY_NOT(f, r) f;
204#define SMTG_DBPRT0(a)
205#define SMTG_DBPRT1(a, b)
206#define SMTG_DBPRT2(a, b, c)
207#define SMTG_DBPRT3(a, b, c, d)
208#define SMTG_DBPRT4(a, b, c, d, e)
209#define SMTG_DBPRT5(a, b, c, d, e, f)
222#if !SMTG_RENAME_ASSERT
227#define ASSERT SMTG_ASSERT
228#define WARNING SMTG_WARNING
229#define DEBUGSTR SMTG_DEBUGSTR
230#define VERIFY SMTG_VERIFY
231#define VERIFY_IS SMTG_VERIFY_IS
232#define VERIFY_NOT SMTG_VERIFY_NOT
233#define PRINTSYSERROR SMTG_PRINTSYSERROR
235#define DBPRT0 SMTG_DBPRT0
236#define DBPRT1 SMTG_DBPRT1
237#define DBPRT2 SMTG_DBPRT2
238#define DBPRT3 SMTG_DBPRT3
239#define DBPRT4 SMTG_DBPRT4
240#define DBPRT5 SMTG_DBPRT5
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
void setSmtgUnitTesting()
Definition fdebug.cpp:316
bool isSmtgUnitTesting()
Definition fdebug.cpp:310
uch * p
Definition crypt.c:594
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
struct zdirent * file
Definition win32.c:1500
_WDL_CSTRING_PREFIX void INT_PTR const char * format
Definition wdlcstring.h:263