immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.95k stars 234 forks source link

Transpile `#include` as `include!()` #1053

Open HKalbasi opened 9 months ago

HKalbasi commented 9 months ago

Currently, each generated file contains a copy of each header file it includes, so to make a change/refactor you will need to change multiple places, making changes harder than necessary. By transpiling C #includes to Rust include!, it will become much easier to refactor without losing the C semantics (which will probably happen by using mod and similars).

kkysen commented 9 months ago

This is a good idea.

pitaj commented 7 months ago

Duplicate of #1050 ?

kkysen commented 7 months ago

Duplicate of #1050 ?

This is a bit different I think.

pitaj commented 7 months ago

They essentially describe the same idea, the only difference is that this one suggests using include!() to implement it.