The `#undef` hack is no longer necessary after changing the redifitions
to not map back to the original symbols.
This makes it unnecessary to repeat the redefinitions after compiling
`warnless.c` itself (in unity mode).
Which in turns makes it unnecessary to include `warnless.h` again, to
trigger such redefinition.
This also means that `read`/`write` are now redefined on Windows from
the first inclusion of `warnless.h`.
Also:
- tests/server: drop a repeat `warnless.h` include, that is unnecessary
after this patch.
- tests/unit: drop repeat `warnless.h` include.
- tests/libtest: drop repeat `warnless.h` includes.
- tests/libtest: formatting.
Follow-up to
2f312a14da94068d58b6a39f79f82acd0bf82149 #17619
Follow-up to
84338c4de2d7c798e3c270c9610d51a4ad18a90b #12331
Follow-up to
6239146e931fd3127f6994975a56d1b4884a708a
Closes #17673
#endif /* __INTEL_COMPILER && __unix__ */
-#ifdef _WIN32
-#undef read
-#undef write
-#endif
-
#include <limits.h>
#define CURL_MASK_UCHAR ((unsigned char)~0)
# pragma warning(pop)
#endif
}
-
-/* Ensure that warnless.h redefinitions continue to have an effect
- in "unity" builds. */
-#undef HEADER_CURL_WARNLESS_H_REDEFS
size_t curlx_sitouz(int sinum);
-#endif /* HEADER_CURL_WARNLESS_H */
-
-#ifndef HEADER_CURL_WARNLESS_H_REDEFS
-#define HEADER_CURL_WARNLESS_H_REDEFS
-
#ifdef _WIN32
#undef read
#define read(fd, buf, count) (ssize_t)_read(fd, buf, curlx_uztoui(count))
#define write(fd, buf, count) (ssize_t)_write(fd, buf, curlx_uztoui(count))
#endif
-#endif /* HEADER_CURL_WARNLESS_H_REDEFS */
+#endif /* HEADER_CURL_WARNLESS_H */
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct t1485_transfer_status {
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1500(char *URL)
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#undef TEST_HANG_TIMEOUT
#include <limits.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1502(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1506(char *URL)
#include "testutil.h"
#include "timediff.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1508(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
size_t WriteOutput(char *ptr, size_t size, size_t nmemb, void *stream);
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1510(char *URL)
*/
#include "test.h"
+
#include "testtrace.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#define DNS_TIMEOUT 1L
#include "testtrace.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static int sockopt_callback(void *clientp, curl_socket_t curlfd,
/* test case and code based on https://github.com/curl/curl/issues/3927 */
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static int dload_progress_cb(void *a, curl_off_t b, curl_off_t c,
#include "testutil.h"
#include "timediff.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1531(char *URL)
#include "testtrace.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct t1540_transfer_status {
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct t1541_transfer_status {
*/
#include "test.h"
+
#include "testutil.h"
#include "testtrace.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1542(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1552(char *URL)
#include "testutil.h"
#include "testtrace.h"
-#include "warnless.h"
#include "memdebug.h"
static int t1553_xferinfo(void *p,
*
***************************************************************************/
#include "test.h"
+
#include "memdebug.h"
static const char *ldata_names[] = {
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct headerinfo {
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1557(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1558(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1559(char *URL)
#endif
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h" /* LAST include file */
static int checkparts(CURLU *u, const char *in, const char *wanted,
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#define WAKEUP_NUM 10
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#ifdef HAVE_PTHREAD_H
*/
#include "test.h"
+
#include <stdio.h>
+
#include "memdebug.h"
static size_t consumed = 0;
CI machines. */
#include "test.h"
+
#include "testutil.h"
#include <sys/stat.h>
*/
#include "test.h"
+
#include <stdio.h>
+
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1900(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static size_t t1901_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
#include "testutil.h"
#include "timediff.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1903(char *URL)
#include "testutil.h"
#include "timediff.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1905(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1906(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1907(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1908(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1910(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/* The maximum string length limit (CURL_MAX_INPUT_LENGTH) is an internal
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#define print_err(name, exp) \
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1913(char *URL)
#include "testtrace.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct state {
***************************************************************************/
#include "test.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1916(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1918(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1919(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib1977(char *URL)
*/
#include "test.h"
+
#include "memdebug.h"
static CURLcode send_request(CURL *curl, const char *url, int seq,
#include <assert.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#define MAX_EASY_HANDLES 3
*
***************************************************************************/
#include "test.h"
+
#include "testtrace.h"
static CURLcode test_lib2306(char *URL)
*
***************************************************************************/
#include "test.h"
+
#include "testtrace.h"
static size_t cb_curl(char *buffer, size_t size, size_t nmemb, void *userp)
*
***************************************************************************/
#include "test.h"
+
#include "testtrace.h"
static size_t cb_ignore(char *buffer, size_t size, size_t nmemb, void *userp)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib2402(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib2404(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/* ---------------------------------------------------------------- */
#include "testtrace.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib2502(char *URL)
*
***************************************************************************/
#include "test.h"
+
#include "testtrace.h"
#include "memdebug.h"
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#define NUM_THREADS 100
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib3027(char *URL)
*
***************************************************************************/
#include "test.h"
+
#include "memdebug.h"
static CURLcode test_lib3100(char *URL)
*
***************************************************************************/
#include "test.h"
+
#include "memdebug.h"
static CURLcode test_lib3101(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib3105(char *URL)
*
***************************************************************************/
#include "test.h"
+
#include "testutil.h"
#include "memdebug.h"
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib3208(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib507(char *URL)
#endif
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#ifndef FD_SETSIZE
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib525(char *URL)
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib526(char *URL)
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct t530_Sockets {
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib533(char *URL)
#endif
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#if !defined(HAVE_POLL) && !defined(USE_WINSOCK) && !defined(FD_SETSIZE)
#include <limits.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#define PROXY libtest_arg2
#include "test.h"
-#include "warnless.h"
#include "memdebug.h"
struct t552_testdata {
*/
#include "test.h"
+
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static const char uploadthis[] = "this is the blurb we want to upload\n";
***************************************************************************/
#include "test.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib556(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib564(char *URL)
#endif
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
#define RTP_PKT_CHANNEL(p) ((int)((unsigned char)((p)[1])))
#include "testtrace.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/* 3x download!
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
struct t582_Sockets {
*
***************************************************************************/
#include "test.h"
+
#include "memdebug.h"
#define THREADS 2
#include <fcntl.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib591(char *URL)
#include <limits.h>
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
*
***************************************************************************/
#include "test.h"
+
#include "memdebug.h"
static CURLcode test_lib661(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static CURLcode test_lib677(char *URL)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
static int loadfile(const char *filename, void **filedata, size_t *filesize)
#include "test.h"
#include "testutil.h"
-#include "warnless.h"
#include "memdebug.h"
/*
#include "testutil.h"
#include "testtrace.h"
-#include "warnless.h"
#include "memdebug.h"
struct t753_transfer_status {
#endif
#include <curlx.h> /* from the private lib dir */
-#include "warnless.h" /* for read() */
/* include memdebug.h last */
#include <memdebug.h>
#include "curlcheck.h"
#include "splay.h"
-#include "warnless.h"
static void splayprint(struct Curl_tree *t, int d, char output)
{