Skip to content

Add rules for more IP constants#142

Open
lucic71 wants to merge 8 commits into
Cpp2Rust:masterfrom
lucic71:ip
Open

Add rules for more IP constants#142
lucic71 wants to merge 8 commits into
Cpp2Rust:masterfrom
lucic71:ip

Conversation

@lucic71
Copy link
Copy Markdown
Contributor

@lucic71 lucic71 commented May 22, 2026

IPPROTO_MPTCP is only defined on Linux. Before #144 the target_os attribute was used in the IR to define symbols that are platform specific in order to keep the IR uniform. But since the IR is not indexed in git anymore, the IR now can be different based on the platform. As such, I deleted the target_os from the IR.

I also took this opportunity to replace the previous manual parsing of function attributes in rust with a proper parser, i.e. the cfg-expr crate. In the future I plan to use more attributes, other than target_os, for which I will need proper parsing of the function attributes. For example we also need target_arch, not only target_os.

@lucic71 lucic71 force-pushed the ip branch 2 times, most recently from 9343ece to 544d922 Compare May 23, 2026 12:46
@lucic71 lucic71 marked this pull request as draft May 23, 2026 12:46
@lucic71 lucic71 marked this pull request as ready for review May 23, 2026 21:09
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.

1 participant