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 // ERROR_H 32