From f3515cbdd584cff4c03a6896ab1eb3d068f1040c Mon Sep 17 00:00:00 2001 From: Brian Demsky Date: Fri, 19 Jan 2018 15:52:10 -0800 Subject: [PATCH 1/1] Improve libc support --- src/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.34.1