lib: make CURLX_SET_BINMODE() and use it

Use it from libtests' `first.c` and thus also from units, and tunits.

Also:
- cmake: drop stray `curltool` lib dependency for units.
- units: stop depending on `src` headers.
- tests/server: drop depending on `src` headers.
  (the remaining one listed in the comments, `tool_xattr.h`, was not
  actually used from servers.)
- tests/server: drop duplicate curlx headers.
  (Except `warnless.h`, which is tricky on Windows.)

Closes #17672
This commit is contained in:
Viktor Szakats 2025-06-19 14:05:25 +02:00
parent 35d0c047ce
commit 916f241f2f
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
18 changed files with 29 additions and 44 deletions

View file

@ -54,7 +54,6 @@ target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
"${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h"
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
"${PROJECT_SOURCE_DIR}/tests/unit" # for "curlcheck.h"
)

View file

@ -37,7 +37,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(top_srcdir)/src \
-I$(srcdir) \
-I$(top_srcdir)/tests/unit

View file

@ -27,7 +27,7 @@
#include "memdebug.h"
#include "curlx/timediff.h"
#include "tool_binmode.h"
#include "curlx/binmode.h"
int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc,
struct timeval *tv)
@ -107,7 +107,7 @@ int main(int argc, char **argv)
char *env;
size_t tmp;
CURL_SET_BINMODE(stdout);
CURLX_SET_BINMODE(stdout);
memory_tracking_init();