From: Richard Kettlewell Date: Thu, 29 Nov 2007 19:35:14 +0000 (+0000) Subject: build fixes X-Git-Tag: 1.5.99+dev10~41 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/6f4d1e2dbd8ef69f2aa88419fdd1bead4c45e2f4?hp=4a99f7ba7e2e1ecc7a09528618e1e3ca54f5727d build fixes --- diff --git a/lib/test.c b/lib/test.c index 07d09a7..781a1fc 100644 --- a/lib/test.c +++ b/lib/test.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "utf8.h" #include "mem.h" @@ -103,34 +104,34 @@ static const char *format_utf32(const uint32_t *s) { return d.vec; } -#define check_string(GOT, WANT) do { \ - const char *g = GOT; \ - const char *w = WANT; \ - \ - if(w == 0) { \ - fprintf(stderr, "%s:%d: %s returned 0\n", \ - __FILE__, __LINE__, #GOT); \ - count_error(); \ - } else if(strcmp(w, g)) { \ - fprintf(stderr, "%s:%d: %s returned:\n%s\nexpected:\n%s\n", \ - __FILE__, __LINE__, #GOT, format(g), format(w)); \ - count_error(); \ - } \ - ++tests; \ +#define check_string(GOT, WANT) do { \ + const char *got = GOT; \ + const char *want = WANT; \ + \ + if(want == 0) { \ + fprintf(stderr, "%s:%d: %s returned 0\n", \ + __FILE__, __LINE__, #GOT); \ + count_error(); \ + } else if(strcmp(want, got)) { \ + fprintf(stderr, "%s:%d: %s returned:\n%s\nexpected:\n%s\n", \ + __FILE__, __LINE__, #GOT, format(got), format(want)); \ + count_error(); \ + } \ + ++tests; \ } while(0) #define check_string_prefix(GOT, WANT) do { \ - const char *g = GOT; \ - const char *w = WANT; \ + const char *got = GOT; \ + const char *want = WANT; \ \ - if(w == 0) { \ + if(want == 0) { \ fprintf(stderr, "%s:%d: %s returned 0\n", \ __FILE__, __LINE__, #GOT); \ - count_error(); \ - } else if(strncmp(w, g, strlen(w))) { \ - fprintf(stderr, "%s:%d: %s returned:\n%s\nexpected:\n%s...\n", \ - __FILE__, __LINE__, #GOT, format(g), format(w)); \ - count_error(); \ + count_error(); \ + } else if(strncmp(want, got, strlen(want))) { \ + fprintf(stderr, "%s:%d: %s returned:\n%s\nexpected:\n%s...\n", \ + __FILE__, __LINE__, #GOT, format(got), format(want)); \ + count_error(); \ } \ ++tests; \ } while(0)