xref: /haiku/src/apps/glteapot/error.h (revision 20ed88dd96c9d58bddbfe3d94cf577e78486c7fa)
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(const char *);
12 
13 #define DEBUGGING 1
14 
15 #undef assert
16 
17 #ifdef DEBUGGING
18 
19 #define assert(a) if (!(a)) { \
20   printf("%s:%d: Failed assertion `"#a"'\n",__FILE__,__LINE__); \
21   fatalerror("Failed assertion!"); };
22 
23 #define checkpoint printf("%s:%d: Checkpoint...\n",__FILE__,__LINE__);\
24                    fflush(stdout);
25 
26 #else //DEBUGGING
27 
28 #define assert(a)
29 #define checkpoint
30 
31 #endif //DEBUGGING
32 
33 #endif // ERROR_H
34