Commit | Line | Data |
---|---|---|
59b161cd PMF |
1 | #ifndef USTERR_H |
2 | #define USTERR_H | |
3 | ||
17674885 PMF |
4 | //#define DEBUG |
5 | #ifdef DEBUG | |
6 | # define DBG(fmt, args...) do { fprintf(stderr, fmt "\n", ## args); fflush(stderr); } while(0) | |
7 | #else | |
8 | # define DBG(fmt, args...) do {} while(0) | |
9 | #endif | |
10 | #define WARN(fmt, args...) fprintf(stderr, "libust: WARNING: " fmt "\n", ## args); fflush(stderr) | |
11 | #define ERR(fmt, args...) fprintf(stderr, "libust: ERROR: " fmt "\n", ## args); fflush(stderr) | |
12 | #define BUG(fmt, args...) fprintf(stderr, "libust: BUG: " fmt "\n", ## args); fflush(stderr) | |
13 | #define PERROR(call) perror("ust: ERROR: " call) | |
c9b64079 PMF |
14 | |
15 | #define BUG_ON(condition) do { if (unlikely(condition)) ERR("condition not respected (BUG)"); } while(0) | |
5f54827b | 16 | #define WARN_ON(condition) do { if (unlikely(condition)) WARN("condition not respected on line %s:%d", __FILE__, __LINE__); } while(0) |
c9b64079 | 17 | |
59b161cd | 18 | #endif /* USTERR_H */ |