7 //#error UST_COMPONENT is undefined
8 #define UST_COMPONENT libust
11 /* To stringify the expansion of a define */
12 #define XSTR(d) STR(d)
15 #define UST_STR_COMPONENT XSTR(UST_COMPONENT)
19 # define DBG(fmt, args...) do { fprintf(stderr, UST_STR_COMPONENT ": " fmt " (" __FILE__ ":" XSTR(__LINE__) ")\n", ## args); fflush(stderr); } while(0)
21 # define DBG(fmt, args...) do {} while(0)
23 #define WARN(fmt, args...) fprintf(stderr, UST_STR_COMPONENT ": Warning: " fmt "\n", ## args); fflush(stderr)
24 #define ERR(fmt, args...) fprintf(stderr, UST_STR_COMPONENT ": Error: " fmt "\n", ## args); fflush(stderr)
25 #define BUG(fmt, args...) fprintf(stderr, UST_STR_COMPONENT ": BUG: " fmt "\n", ## args); fflush(stderr)
27 #if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)
28 #define PERROR(call, args...)\
30 char buf[200] = "Error in strerror_r()"; \
31 strerror_r(errno, buf, sizeof(buf)); \
32 fprintf(stderr, UST_STR_COMPONENT ": Error: " call ": %s\n", ## args, buf); fflush(stderr); \
35 #define PERROR(call, args...)\
39 buf = strerror_r(errno, tmp, sizeof(tmp)); \
40 fprintf(stderr, UST_STR_COMPONENT ": Error: " call ": %s\n", ## args, buf); fflush(stderr); \
44 #define BUG_ON(condition) do { if (unlikely(condition)) ERR("condition not respected (BUG)"); } while(0)
45 #define WARN_ON(condition) do { if (unlikely(condition)) WARN("condition not respected on line %s:%d", __FILE__, __LINE__); } while(0)
This page took 0.032427 seconds and 5 git commands to generate.