File: errx.h

package info (click to toggle)
minc 2.1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,160 kB
  • sloc: ansic: 82,507; sh: 10,666; yacc: 1,187; perl: 612; makefile: 586; lex: 319
file content (12 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
/* Just in case you don't have errx, but you have gcc */

#if !defined(__OpenBSD__) && defined(__GNUC__)
# define errx(exitcode, fmt , args) \
   do { fprintf(stderr, "imgcalc: " fmt "\n", ## args ); exit(1); } while(0)
# define err(exitcode, fmt , args) \
   do { fprintf(stderr, "imgcalc: " fmt , ## args ); \
      fprintf(stderr, ": %s\n", strerror(errno)); exit(1); } while(0)
#else
# include <errno.h>
#endif