From 9a7c211b572ade3ed74c1db706d3e450bf32bde7 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 6 Jan 2007 14:02:51 +0000 Subject: [PATCH] * Fix build with older versions of gcc. --- src/debug.c | 19 +++++++++++-------- src/zzuf.c | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/debug.c b/src/debug.c index 21a3598..f46d729 100644 --- a/src/debug.c +++ b/src/debug.c @@ -37,15 +37,18 @@ extern int _zz_hasdebug; #define WRITE_INT(fd, i, base) \ - char buf[128], *b = buf + 127; \ - if(i <= 0) \ - write(fd, (i = -i) ? "-" : "0", 1); /* XXX: hack here */ \ - while(i) \ + do \ { \ - *b-- = hex2char[i % base]; \ - i /= base; \ - } \ - write(fd, b + 1, buf + 127 - b) + char buf[128], *b = buf + 127; \ + if(i <= 0) \ + write(fd, (i = -i) ? "-" : "0", 1); /* XXX: hack here */ \ + while(i) \ + { \ + *b-- = hex2char[i % base]; \ + i /= base; \ + } \ + write(fd, b + 1, buf + 127 - b); \ + } while(0) void _zz_debug(char const *format, ...) { diff --git a/src/zzuf.c b/src/zzuf.c index 9ab7bc3..8c903e3 100644 --- a/src/zzuf.c +++ b/src/zzuf.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include