File: mol_assert.h

package info (click to toggle)
mol 0.9.61-6
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 6,140 kB
  • ctags: 8,491
  • sloc: ansic: 50,560; asm: 2,826; sh: 458; makefile: 373; perl: 165; lex: 135; yacc: 131
file content (29 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
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
/* 
 *   Creation Date: <2001/01/27 15:12:25 samuel>
 *   Time-stamp: <2001/02/03 20:21:54 samuel>
 *   
 *	<mol_assert.h>
 *	
 *	Assert macros
 *   
 *   Copyright (C) 2000 Samuel Rydh (samuel@ibrium.se)
 *   
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation
 *   
 */

#ifndef _H_MOL_ASSERT
#define _H_MOL_ASSERT

#define ENABLE_ASSERT

#ifdef ENABLE_ASSERT
#define assert( cond ) \
	({ if( !(cond) ) { printm("Assertion failed in " __FUNCTION__ "(), ("__FILE__", line %d)\n", __LINE__); exit(1); }})
#else
#define assert( cond )
#endif

#endif   /* _H_MOL_ASSERT */