2010-04-16 22:39:56 +02:00
|
|
|
#ifndef _ERR_H_
|
|
|
|
#define _ERR_H_
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2010-11-17 09:29:41 +01:00
|
|
|
#define warnx(...) do { \
|
2012-05-29 17:52:51 +02:00
|
|
|
fprintf (stderr, __VA_ARGS__); \
|
|
|
|
fprintf (stderr, "\n"); \
|
|
|
|
} while (0)
|
2010-11-17 09:29:41 +01:00
|
|
|
|
2010-04-16 22:39:56 +02:00
|
|
|
#define errx(code, ...) do { \
|
2012-05-29 17:52:51 +02:00
|
|
|
fprintf (stderr, __VA_ARGS__); \
|
|
|
|
fprintf (stderr, "\n"); \
|
|
|
|
exit (code); \
|
|
|
|
} while (0)
|
2010-04-16 22:39:56 +02:00
|
|
|
|
2011-03-31 15:38:49 +02:00
|
|
|
#define err errx
|
2011-03-30 11:26:23 +02:00
|
|
|
|
2010-04-16 22:39:56 +02:00
|
|
|
#endif /* !_ERR_H_ */
|