fix(cust_raw): Use string macro expansion to record function renames#191
Merged
jorge-ortega merged 2 commits intoRust-GPU:mainfrom Apr 9, 2025
Merged
fix(cust_raw): Use string macro expansion to record function renames#191jorge-ortega merged 2 commits intoRust-GPU:mainfrom
jorge-ortega merged 2 commits intoRust-GPU:mainfrom
Conversation
Contributor
|
When we test the cust_raw pkg, we might need to enable all features so all the bindgens are generated. |
dc5bbed to
9382b36
Compare
`cl.exe` macro expansion does not do any token validation when using token pasting (##), but `cc` does validate token pasting results in a valid token. This change switches from token pasting to stringify (#), which expands all the macro function variables as strings. Rename lines now expand to `"RUST_RENAME" "_someDefine" "expandedFuncName"`. This prevents `cc` from erroring during expanding in cases where the expanded macro would have resulted in an invalid token, i.e: `RUST_RENAME_someDefine_(not_valid)` which is invalid because the `(` is not a valid token character.
This adds a step to build all features of `cust_raw` to validate all the bindings it generates can build successfully.
9382b36 to
a625051
Compare
Collaborator
Author
|
Added a CI build step to do just that. I learned Windows mounts remain case insensitive in a dev container. |
Contributor
Yeah, should be same across case insensitive filesystems. |
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.
cl.exemacro expansion does not do any token validation when using token pasting (##), butccdoes validate token pasting results in a valid token. This change switches from token pasting to stringify (#), which expands all the macro function variables as strings. Rename lines now expand to"RUST_RENAME" "_someDefine" "expandedFuncName". This preventsccfrom erroring during expanding in cases where the expanded macro would have resulted in an invalid token, i.e:RUST_RENAME_someDefine_(not_valid)which is invalid because the(is not a valid token character.