Skip to content

Commit c0e300b

Browse files
committed
Add 'WRN' macro
1 parent 638bac5 commit c0e300b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/include/util.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,24 @@
3232
*/
3333
#define LENGTH(ARR) (sizeof(ARR) / sizeof((ARR)[0]))
3434

35+
/*
36+
* Print a warning with the specified format, along with the program name and a
37+
* newline.
38+
*/
39+
#define WRN(...) \
40+
do { \
41+
fprintf(stderr, "bin-graph: Warning: "); \
42+
fprintf(stderr, __VA_ARGS__); \
43+
fputc('\n', stderr); \
44+
} while (0)
45+
3546
/*
3647
* Print an error with the specified format, along with the program name and a
3748
* newline.
3849
*/
3950
#define ERR(...) \
4051
do { \
41-
fprintf(stderr, "bin-graph: "); \
52+
fprintf(stderr, "bin-graph: Error: "); \
4253
fprintf(stderr, __VA_ARGS__); \
4354
fputc('\n', stderr); \
4455
} while (0)

0 commit comments

Comments
 (0)