mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:03:38 +03:00
warnless: drop parts of the read/write preprocessor hack (Windows)
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 to2f312a14da#17619 Follow-up to84338c4de2#12331 Follow-up to6239146e93Closes #17673
This commit is contained in:
parent
6c1a7541fb
commit
0042770157
97 changed files with 20 additions and 96 deletions
|
|
@ -35,11 +35,6 @@
|
|||
|
||||
#endif /* __INTEL_COMPILER && __unix__ */
|
||||
|
||||
#ifdef _WIN32
|
||||
#undef read
|
||||
#undef write
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define CURL_MASK_UCHAR ((unsigned char)~0)
|
||||
|
|
@ -295,7 +290,3 @@ size_t curlx_sitouz(int sinum)
|
|||
# pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Ensure that warnless.h redefinitions continue to have an effect
|
||||
in "unity" builds. */
|
||||
#undef HEADER_CURL_WARNLESS_H_REDEFS
|
||||
|
|
|
|||
|
|
@ -57,11 +57,6 @@ unsigned short curlx_uitous(unsigned int uinum);
|
|||
|
||||
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))
|
||||
|
|
@ -69,4 +64,4 @@ size_t curlx_sitouz(int sinum);
|
|||
#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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue