c2rust icon indicating copy to clipboard operation
c2rust copied to clipboard

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

Open HKalbasi opened this issue 8 months ago • 4 comments

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).

HKalbasi avatar Dec 17 '23 21:12 HKalbasi

This is a good idea.

kkysen avatar Dec 17 '23 21:12 kkysen

Duplicate of #1050 ?

pitaj avatar Mar 04 '24 04:03 pitaj

Duplicate of #1050 ?

This is a bit different I think.

kkysen avatar Mar 04 '24 09:03 kkysen

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

pitaj avatar Mar 04 '24 16:03 pitaj