/* * misc helper code * * Written by Mike Frysinger * Released into the public domain */ #include #include #include #include #include #include #include #include "srf.h" #define warn(fmt, ...) \ fprintf(stderr, "srf2png: %s: " fmt "\n", __func__, ## __VA_ARGS__) #define err(fmt, ...) \ do { \ warn(fmt, ## __VA_ARGS__); \ exit(1); \ } while (0) #define msg(fmt, ...) printf("srf2png: " fmt "\n", ## __VA_ARGS__) #define MAX(x, y) ((x) < (y) ? (y) : (x))