aboutsummaryrefslogblamecommitdiff
path: root/include/util.h
blob: 2f1c34142433d5c12a1fe02d2cd5134d65a204ac (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                  
 
                                                                                

                                                                               
                                                                                
                                                                                
                                                                                

                                                                                
#include <stdio.h>

#define print_err(fmt, ...)                                                    \
	fprintf(stderr, "[%s:%d] " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)

#define return_err(r, fmt, ...)                                                \
	do {                                                                   \
		print_err(fmt, ##__VA_ARGS__);                                 \
		return r;                                                      \
	} while (0)