From 8a1f361716ab0bbf1e15f8a9914b9f1f07855bae Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 20 Mar 2026 10:58:44 +0100 Subject: [PATCH] build: limit `unitprotos.h` include to `units` target To omit it from `tunits`. Also: move the include to `unitcheck.h` to save a guard. Ref: https://github.com/curl/curl/pull/21014#issuecomment-4093742896 Reported-by: Daniel Stenberg Fixes #21021 Follow-up to 98d8e82c7471232639841eb63e16bb979a30acb4 #21014 Closes #21024 --- tests/libtest/first.h | 4 ---- tests/libtest/unitcheck.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 5b3ee2d448..062cd169be 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -43,10 +43,6 @@ extern const struct entry_s s_entries[]; extern int unitfail; /* for unittests */ -#ifdef UNITTESTS -#include "unitprotos.h" -#endif - #include "curlx/base64.h" /* for curlx_base64* */ #include "curlx/dynbuf.h" /* for curlx_dyn_*() */ #include "curlx/fopen.h" /* for curlx_f*() */ diff --git a/tests/libtest/unitcheck.h b/tests/libtest/unitcheck.h index fa71757fb9..462f8b45f3 100644 --- a/tests/libtest/unitcheck.h +++ b/tests/libtest/unitcheck.h @@ -23,6 +23,10 @@ ***************************************************************************/ #include "first.h" +#ifdef BUILDING_LIBCURL +#include "unitprotos.h" +#endif + /* The fail macros mark the current test step as failed, and continue */ #define fail_if(expr, msg) \ do { \