warnless: replace read()/write() wrapper functions with macros (Windows)#17619
Closed
vszakats wants to merge 1 commit intocurl:masterfrom
Closed
warnless: replace read()/write() wrapper functions with macros (Windows)#17619vszakats wants to merge 1 commit intocurl:masterfrom
read()/write() wrapper functions with macros (Windows)#17619vszakats wants to merge 1 commit intocurl:masterfrom
Conversation
read()/write() function wrappers with macros (Windows)
read()/write() function wrappers with macros (Windows)read()/write() wrapper functions with macros (Windows)
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jun 19, 2025
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jun 19, 2025
vszakats
added a commit
that referenced
this pull request
Jun 19, 2025
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 2f312a1 #17619 Follow-up to 84338c4 #12331 Follow-up to 6239146 Closes #17673
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
…indows) Map them to `_read()`/`_write()` (with underscore) to avoid recursive mapping and to use the non-compatibility naming on Windows. https://learn.microsoft.com/cpp/c-runtime-library/reference/read https://learn.microsoft.com/cpp/c-runtime-library/reference/write Follow-up to 6239146 Closes curl#17619
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
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 2f312a1 curl#17619 Follow-up to 84338c4 curl#12331 Follow-up to 6239146 Closes curl#17673
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Map them to
_read()/_write()(with underscore) to avoid recursivemapping and to use the non-compatibility naming on Windows.
https://learn.microsoft.com/cpp/c-runtime-library/reference/read
https://learn.microsoft.com/cpp/c-runtime-library/reference/write
Follow-up to 6239146