From: Ondřej Surý Date: Tue, 1 Dec 2020 14:08:49 +0000 (+0100) Subject: The cmocka.h header MUST be included before isc/util.h gets included X-Git-Tag: v9.16.11~17^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b2184893d167a201e1edff80c18c3dc81fb4851;p=thirdparty%2Fbind9.git The cmocka.h header MUST be included before isc/util.h gets included The isc/util.h header redefine the DbC checks (REQUIRE, INSIST, ...) to be cmocka "fake" assertions. However that means that cmocka.h needs to be included after UNIT_TESTING is defined but before isc/util.h is included. Because isc/util.h is included in most of the project headers this means that the sequence MUST be: #define UNIT_TESTING #include #include See !2204 for other header requirements for including cmocka.h. (cherry picked from commit 0ba697fe8c3a05fc7723529fa20ea9c7865e5b6c) --- diff --git a/lib/isc/tests/task_test.c b/lib/isc/tests/task_test.c index 9cbe1c99c69..f4a44a12c57 100644 --- a/lib/isc/tests/task_test.c +++ b/lib/isc/tests/task_test.c @@ -23,6 +23,8 @@ #define UNIT_TESTING +#include + #include #include #include