/*-----------------------------------------------------------------------------+
|                                                                              |
|       Copyright (c), Raisonance S.A.S., 1987-2007                            |
|                                                                              |
+------------------------------------------------------------------------------+
|                                                                              |
|       File: ASSERT.H                                                         |
|                                                                              |
+--------------+-------+----------------------------------------------+--------+
|     DATE     |VERSION| HISTORY/CHANGES                              |   BY   |
|  (MM/DD/YY)  | VX.Y  |                                              |        |
+--------------+-------+----------------------------------------------+--------+
|   ??/??/??   |  1.0  | Initial implementation                       |   XX   |
|   11/07/02   |  1.1  | Reimplementation                             |   JR   |
|   06/04/06   |  1.2  | Optimized: Now uses puts instead of printf   |   BRD  |
+--------------+-------+----------------------------------------------+--------+
|Purpose    :                                                                  |
|   Prototypes and macros to add diagnostics to programs                       |
+-----------------------------------------------------------------------------*/

#undef assert

#ifndef _STDIO_H_
#include <stdio.h>   /* prototype for 'printf' */
#endif               /* _STDIO_H_ */

#ifndef NDEBUG
   #define _STR(s) _VAL(s)
   #define _VAL(s) #s
   #define assert(_expr) ((_expr) ? (void)0 : \
           (void)puts("Assertion failed: (" #_expr ") file " __FILE__ ", line " _STR(__LINE__)))
#else
   #define assert(_expr) ((void)0)
#endif  /* NDEBUG */
