home *** CD-ROM | disk | FTP | other *** search
- #ifndef __ASSERT_H__
- #define __ASSERT_H__
-
- #include <stdio.h>
-
- /* These macros prevent errors from propagating throughout the code.
- They identify the line that caused the error. */
-
- #define ASSERT(expr) \
- if (!expr) { \
- printf("FATAL ERROR: Assert failed on line %d (%s)\n", \
- __LINE__,__FILE__); \
- exit(-1); \
- }
-
- #define WARN(expr) \
- if (!expr) \
- printf("SEVERE ERROR: Assert failed on line %d (%s)\n", \
- __LINE__,__FILE__);
-
-
- #endif
-