From: Ondřej Surý Date: Tue, 18 Jun 2019 12:56:41 +0000 (+0200) Subject: Make CHECK() macro local by moving it from dnstest.h to respective .c files X-Git-Tag: v9.15.2~47^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a1f24a863aba9e62f2956c0418d81a6cb2756d0;p=thirdparty%2Fbind9.git Make CHECK() macro local by moving it from dnstest.h to respective .c files The CHECK() macro has been defined both in dnstest.h and update.c files. This has created a conflict between macro definitions when including both of the files in update_test.c. While the CHECK() macro is convenient for the tests, it has been really used in just two files, so the MR moves them into those respective .c files. --- diff --git a/lib/dns/tests/dnstest.c b/lib/dns/tests/dnstest.c index 55109452721..d30780f461b 100644 --- a/lib/dns/tests/dnstest.c +++ b/lib/dns/tests/dnstest.c @@ -53,6 +53,14 @@ #include "dnstest.h" +#define CHECK(r) \ + do { \ + result = (r); \ + if (result != ISC_R_SUCCESS) { \ + goto cleanup; \ + } \ + } while (0) + isc_mem_t *mctx = NULL; isc_log_t *lctx = NULL; isc_taskmgr_t *taskmgr = NULL; diff --git a/lib/dns/tests/dnstest.h b/lib/dns/tests/dnstest.h index 96022780ef4..cc485232c6a 100644 --- a/lib/dns/tests/dnstest.h +++ b/lib/dns/tests/dnstest.h @@ -27,13 +27,6 @@ #include #include -#define CHECK(r) \ - do { \ - result = (r); \ - if (result != ISC_R_SUCCESS) \ - goto cleanup; \ - } while (0) - typedef struct { dns_diffop_t op; const char *owner; diff --git a/lib/dns/tests/tsig_test.c b/lib/dns/tests/tsig_test.c index df2ef474a4b..c1883ddcf87 100644 --- a/lib/dns/tests/tsig_test.c +++ b/lib/dns/tests/tsig_test.c @@ -35,6 +35,14 @@ #include "dnstest.h" +#define CHECK(r) \ + do { \ + result = (r); \ + if (result != ISC_R_SUCCESS) { \ + goto cleanup; \ + } \ + } while (0) + #define TEST_ORIGIN "test" static int