Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / guicast / error.h
blobc8473e806129e0d0b83c393c36bb5610acdf5352
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 */
28 // Local Variables:
29 // mode: C++
30 // c-file-style: "linux"
31 // End: