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

Recognize windows-sys signatures as "C" or "system" depending on cfg #677

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 13, 2024

Closes #676.

This is not an ideal solution because it relies on --cfg=windows_raw_dylib to be passed to backtrace if and only if the same flag is passed to windows-targets. In Cargo this would always be the case and in Buck it's easy to arrange; not sure about different build systems.

I did not come up with a way to write a check that succeeds if super::windows_sys::$name is unsafe extern "C" fn($($argty),*) -> $ret OR unsafe extern "system" fn($($argty),*) -> $ret and fails for all other signatures.

@ChrisDenton
Copy link
Member

This will need to exclude x86 because Windows x86 is the only target where the "system" is not the same as "C".

Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

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

Thanks!

CI is currently failing for unrelated reasons but the change is fairly straightforward and I've tested locally so I'm happy to merge this to unblock use of raw-dylib.

@ChrisDenton ChrisDenton merged commit 26ab4af into rust-lang:master Nov 13, 2024
29 of 44 checks passed
@dtolnay dtolnay deleted the rawdylib branch November 13, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v0.3.74 fails to build on Windows
2 participants