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 98d8e82c74 #21014

Closes #21024
This commit is contained in:
Viktor Szakats 2026-03-20 10:58:44 +01:00
parent 2b3332e749
commit 8a1f361716
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View 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*() */

View File

@ -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 { \