]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: limit `unitprotos.h` include to `units` target
authorViktor Szakats <commit@vsz.me>
Fri, 20 Mar 2026 09:58:44 +0000 (10:58 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 20 Mar 2026 10:31:35 +0000 (11:31 +0100)
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
tests/libtest/unitcheck.h

index 5b3ee2d44856eaebcd467777feecc732e6dfa86a..062cd169be09478304124e2291ca20877c7a7b1f 100644 (file)
@@ -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*() */
index fa71757fb93680871ec6c53339d71bb9ab61b076..462f8b45f32c52220949dca00a3c69f3132dc93e 100644 (file)
  ***************************************************************************/
 #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 {                                                                 \