Skip to content

Translate offsetof in refcount#255

Merged
nunoplopes merged 2 commits into
Cpp2Rust:masterfrom
lucic71:offsetof-refcount
Jul 14, 2026
Merged

Translate offsetof in refcount#255
nunoplopes merged 2 commits into
Cpp2Rust:masterfrom
lucic71:offsetof-refcount

Conversation

@lucic71

@lucic71 lucic71 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Refcount structs don't have the same layout as C structs. Don't translate offsetof as std::mem::offset_of, instead let clang evaluate the offset and hardcode it in the generated rust code. ByteRepr takes care of using it correctly.

@nunoplopes nunoplopes merged commit ebbf77d into Cpp2Rust:master Jul 14, 2026
9 checks passed
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.

2 participants