smb: do not redefine getpid on Windows - #15263
Closed
vszakats wants to merge 3 commits into
Closed
Conversation
Make an `#if` branch instead for the single place it was used. Redefining symbols can backfire if that symbol is used in system headers, especially in unity build. We haven't seen a fallout in CI or supported envs, but do it anyway for good measure. Bug report: https://datagirl.xyz/posts/wolfssl_curl_w2k.html
bagder
reviewed
Oct 11, 2024
bagder
left a comment
Member
There was a problem hiding this comment.
In general I find code easier to read and work with without #ifdefs in the midst of it, hence it is better to define a macro and use that rather than this approach.
Perhaps Curl_getpid() ?
Member
Author
Yes, that can work. I skipped it initially for simplicity but this is perhaps more future proof indeed. Also moved the cast inside the macro, do you think it's OK? |
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Replace with namespaced local macro `Curl_getpid()`. Redefining symbols can backfire if that symbol is used in system headers, especially with unity build. We haven't seen a fallout in CI or supported envs, but do it anyway for good measure. Bug report: https://datagirl.xyz/posts/wolfssl_curl_w2k.html Closes curl#15263
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.
Replace with namespaced local macro
Curl_getpid().Redefining symbols can backfire if that symbol is used in system
headers, especially with unity build. We haven't seen a fallout in CI
or supported envs, but do it anyway for good measure.
Bug report: https://datagirl.xyz/posts/wolfssl_curl_w2k.html