X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2Fcommon.h;h=256aaf335a75431bc6cd99235dbded710164388b;hp=7343c83fd7dcdb58d1bc1016124a2ef24d555e01;hb=f3515cbdd584cff4c03a6896ab1eb3d068f1040c;hpb=cd362e8c49a8ac25e3f0324e89d139285cb71c3d diff --git a/src/common.h b/src/common.h index 7343c83..256aaf3 100644 --- a/src/common.h +++ b/src/common.h @@ -24,7 +24,7 @@ extern int model_out; extern int model_err; extern int switch_alloc; -#define model_dprintf(fd, fmt, ...) do { switch_alloc = 1; dprintf(fd, fmt, ## __VA_ARGS__); switch_alloc = 0; } while (0) +#define model_dprintf(fd, fmt, ...) do { int oldsw = switch_alloc; switch_alloc = 1; dprintf(fd, fmt, ## __VA_ARGS__); switch_alloc = oldsw; } while (0) #define model_print(fmt, ...) do { model_dprintf(model_out, fmt, ## __VA_ARGS__); } while (0) #define model_print_err(fmt, ...) do { model_dprintf(model_err, fmt, ## __VA_ARGS__); } while (0)