File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / quagga / lib / zassert.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 17:26:12 2012 UTC (12 years, 4 months ago) by misho
Branches: quagga, MAIN
CVS tags: v0_99_22p0, v0_99_22, v0_99_21, v0_99_20_1, v0_99_20, HEAD
quagga

    1: /*
    2:  * $Id: zassert.h,v 1.1.1.1 2012/02/21 17:26:12 misho Exp $
    3:  */
    4: 
    5: #ifndef _QUAGGA_ASSERT_H
    6: #define _QUAGGA_ASSERT_H
    7: 
    8: extern void _zlog_assert_failed (const char *assertion, const char *file,
    9: 				 unsigned int line, const char *function)
   10: 				 __attribute__ ((noreturn));
   11: 
   12: #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
   13: #define __ASSERT_FUNCTION    __func__
   14: #elif defined(__GNUC__)
   15: #define __ASSERT_FUNCTION    __FUNCTION__
   16: #else
   17: #define __ASSERT_FUNCTION    NULL
   18: #endif
   19: 
   20: #define zassert(EX) ((void)((EX) ?  0 :	\
   21: 			    (_zlog_assert_failed(#EX, __FILE__, __LINE__, \
   22: 						 __ASSERT_FUNCTION), 0)))
   23: 
   24: #undef assert
   25: #define assert(EX) zassert(EX)
   26: 
   27: #endif /* _QUAGGA_ASSERT_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>