Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smb: do not redefine getpid on Windows #15263

Closed
wants to merge 3 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Oct 11, 2024

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

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
@vszakats vszakats added Windows Windows-specific tidy-up SMB labels Oct 11, 2024
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() ?

@vszakats
Copy link
Member Author

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() ?

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants