xref: /haiku/src/apps/glteapot/error.h (revision 0b2dbe7d46ee888392907c60131b7f7652314175)
1 /*
2 	Copyright 1999, Be Incorporated.   All Rights Reserved.
3 	This file may be used under the terms of the Be Sample Code License.
4 */
5 
6 #ifndef error_h
7 #define error_h
8 
9 #include <stdio.h>
10 
11 extern void fatalerror(char *);
12 
13 #define DEBUGGING 1
14 
15 #ifdef DEBUGGING
16 
17 #define assert(a) if (!(a)) { \
18   printf("%s:%d: Failed assertion `"#a"'\n",__FILE__,__LINE__); \
19   fatalerror("Failed assertion!"); };
20 
21 #define checkpoint printf("%s:%d: Checkpoint...\n",__FILE__,__LINE__);\
22                    fflush(stdout);
23 
24 #else //DEBUGGING
25 
26 #define assert(a)
27 #define checkpoint
28 
29 #endif //DEBUGGING
30 
31 #endif
32