Morph-SynRJ

view sys_assert.h @ 0:22de913c2d84

morph-synrj intro
author "Cedric Pinson <cedric.pinson@alcove.fr> <mornifle@plopbyte.net>"
date Tue Nov 27 15:23:52 2007 +0100 (2007-11-27)
parents
children
line source
1 /** @file sys_assert.h
2 *
3 * @brief Assert debug function
4 *
5 *****************************************************************************
6 *
7 * @author psc80
8 *
9 * @date Created 2001/05
10 *
11 * @version $Id: sys_assert.h,v 1.2 2004/01/18 10:43:42 psc80 Exp $
12 *
13 ****************************************************************************/
15 #ifndef SYS_ASSERT_H
16 #define SYS_ASSERT_H
18 #ifndef FINALE_RELEASE
21 void sysAssertInternal(const char* text, const char* file, int line);
23 inline void sysAssert(bool test, const char* text,
24 const char* file, int line) {
25 if (!test)
26 sysAssertInternal(text, file, line);
27 }
29 #define SYS_ASSERT(test) \
30 sysAssert(test, \
31 "\nSYS_ASSERT FAILED AT %s (%d) : '"#test"'\n\n", __FILE__, __LINE__)
33 #else // #if SYS_USE_ASSERT
35 #define SYS_ASSERT(test) // nothing ...
39 #endif // #ifdef SYS_ASSERT_H
46 #endif