1 /* 2 * PROPRIETARY INFORMATION. This software is proprietary to POWDER 3 * Development, and is not to be reproduced, transmitted, or disclosed 4 * in any way without written permission. 5 * 6 * Produced by: Jeff Lait 7 * 8 * POWDER Development 9 * 10 * NAME: assert.h ( POWDER Library, C++ ) 11 * 12 * COMMENTS: 13 * Standard UT_ASSERT definitions. These should be used rather than 14 * system dependent ASSERT or assert. 15 * (The builtin HAM assert is rather annoying as it corrupts vram) 16 * 17 * When an assert is triggered, it freezes game play with the 18 * relevant message until both R & L are pressed & released. 19 */ 20 21 #ifndef __assert__ 22 #define __assert__ 23 24 //#define USEASSERT 25 26 #ifdef STRESS_TEST 27 #define USEASSERT 28 #endif 29 30 #ifdef USING_SDL 31 #ifdef _DEBUG 32 #define USEASSERT 33 #endif 34 #endif 35 36 #ifdef USEASSERT 37 38 void triggerassert(int cond, const char *msg, int line, const char *file); 39 40 #define UT_ASSERT(cond) \ 41 triggerassert(cond, #cond, __LINE__, __FILE__) 42 #define UT_ASSERT2(cond, msg) \ 43 triggerassert(cond, msg, __LINE__, __FILE__) 44 45 #else 46 47 #define UT_ASSERT(cond) 48 #define UT_ASSERT2(cond, msg) 49 50 #endif 51 52 #endif 53