File: assert.h

package info (click to toggle)
powder 117-2
  • links: PTS
  • area: non-free
  • in suites: stretch
  • size: 10,576 kB
  • ctags: 3,545
  • sloc: cpp: 55,002; makefile: 541; sh: 258; objc: 245; ansic: 107; csh: 54
file content (52 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * PROPRIETARY INFORMATION.  This software is proprietary to POWDER
 * Development, and is not to be reproduced, transmitted, or disclosed
 * in any way without written permission.
 *
 * Produced by:	Jeff Lait
 *
 *      	POWDER Development
 *
 * NAME:        assert.h ( POWDER Library, C++ )
 *
 * COMMENTS:
 *	Standard UT_ASSERT definitions.  These should be used rather than
 *	system dependent ASSERT or assert.
 *	(The builtin HAM assert is rather annoying as it corrupts vram)
 *
 * 	When an assert is triggered, it freezes game play with the 
 *	relevant message until both R & L are pressed & released.
 */

#ifndef __assert__
#define __assert__

//#define USEASSERT

#ifdef STRESS_TEST
#define USEASSERT
#endif

#ifdef USING_SDL
#ifdef _DEBUG
#define USEASSERT
#endif
#endif

#ifdef USEASSERT

void triggerassert(int cond, const char *msg, int line, const char *file);

#define UT_ASSERT(cond) \
	triggerassert(cond, #cond, __LINE__, __FILE__)
#define UT_ASSERT2(cond, msg) \
	triggerassert(cond, msg, __LINE__, __FILE__)

#else

#define UT_ASSERT(cond)     
#define UT_ASSERT2(cond, msg)     

#endif

#endif