@@ -295,6 +295,8 @@ inline void OutputDebugFormatA(const char *pszFormat, ...) {
295
295
// This prints 'Hello World (i > 10)' and breaks in the debugger if the
296
296
// assertion doesn't hold.
297
297
//
298
+
299
+ #if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
298
300
#define DXASSERT_ARGS (exp, fmt, ...) \
299
301
do { \
300
302
if (!(exp)) { \
@@ -304,6 +306,19 @@ inline void OutputDebugFormatA(const char *pszFormat, ...) {
304
306
__debugbreak (); \
305
307
} \
306
308
} while (0 )
309
+ #else
310
+ #define DXASSERT_ARGS (exp, fmt, ...) \
311
+ do { \
312
+ if (!(exp)) { \
313
+ OutputDebugFormatA (" Error: \t %s\n File:\n %s(%d)\n Func:\t %s.\n\t " fmt \
314
+ " \n " , \
315
+ " !(" #exp " )" , __FILE__, __LINE__, \
316
+ __FUNCTION__ __VA_OPT__ (, ) __VA_ARGS__); \
317
+ __debugbreak (); \
318
+ } \
319
+ } while (0 )
320
+ #endif
321
+
307
322
#define DXASSERT (exp, msg ) DXASSERT_ARGS(exp, msg)
308
323
309
324
#define DXASSERT_LOCALVAR (local, exp, msg ) DXASSERT(exp, msg)
@@ -325,13 +340,23 @@ inline void OutputDebugFormatA(const char *pszFormat, ...) {
325
340
326
341
#define DXVERIFY_NOMSG assert
327
342
343
+ #if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
328
344
#define DXASSERT_ARGS (expr, fmt, ...) \
329
345
do { \
330
346
if (!(expr)) { \
331
347
fprintf (stderr, fmt, __VA_ARGS__); \
332
348
assert (false ); \
333
349
} \
334
350
} while (0 )
351
+ #else
352
+ #define DXASSERT_ARGS (expr, fmt, ...) \
353
+ do { \
354
+ if (!(expr)) { \
355
+ fprintf (stderr, fmt __VA_OPT__ (, ) __VA_ARGS__); \
356
+ assert (false ); \
357
+ } \
358
+ } while (0 )
359
+ #endif
335
360
336
361
#define DXASSERT (expr, msg ) \
337
362
do { \
0 commit comments