r878: This is Cinelerra 2.1.
[cinelerra_cv/ct.git] / guicast / error.h
blob3a3221f742778de4582059ff0094bcef09ee1210
1 #ifndef _ERROR_H
2 #define _ERROR_H
4 #include <stdio.h>
6 #define SUCCESS 0
7 #define FAILURE 1
9 #define TRUE 1
10 #define FALSE 0
12 // print a warning (when return value is ignored)
13 #define WARN(format, args...) fprintf(stderr, "[%s:%d %s()] " format "\n", \
14 __FILE__, __LINE__, __func__, ## args)
16 // print a warning with return value of FAILURE
17 #define ERROR(format, args...) (WARN(format, ## args), FAILURE)
19 // NOTE: ASSERT is used only when you want to issue a warning in a case
20 // that should not happen and when there is no way to recover.
21 // If there is any way to recover, use ERROR() and handle the problem.
22 //#define ASSERT(x, args...) if (! x) WARN("ASSERT FAILED (" #x ") " args)
24 #endif /* _ERROR_H */