atilaneves / dpp

Directly include C headers in D source code
Boost Software License 1.0
227 stars 31 forks source link

Treat .c files as C headers #345

Closed denizzzka closed 4 weeks ago

denizzzka commented 1 month ago

(Rare but useful case)

Standards isn't prohibit directive like #include "c_file.c". But if included file is .c or .i (preprocessed file) it will allways be treated as C++ header by dpp.

I planning to use this change to ease creating bindings by adding -save-temps flag into (almost any) C build environment and then processing obtained preprocessed files by dpp - so it helps to avoid of collecting of C compilation flags and passing all of them into dpp

denizzzka commented 1 month ago

.i files excluded because preprocessing of C++ files produces files with same extension

denizzzka commented 1 month ago

Test is coming soon