Skip to content

[clang-include-cleaner][Feature Request] Add an option to wrap extern "C" for certain headers #110225

Open
@bc-lee

Description

@bc-lee

While clang-include-cleaner works fine for me in most cases, some C++-hostile projects (like ffmpeg) require their headers to be wrapped with extern "C" to avoid C++ name mangling. When I run clang-include-cleaner on projects that use such headers, I have to manually wrap them with extern "C" afterward. It would be helpful if clang-include-cleaner could handle this automatically.

For example, adding an option like --wrap-extern-c would allow clang-include-cleaner to wrap specified headers, and it could be used like this:

$ /path/to/bin/clang-include-cleaner -p cmake-build-debug --edit --wrap-extern-c=libavcodec,libavformat,libavutil ...

This option would wrap all headers from libavcodec, libavformat, and libavutil with extern "C".

Thanks for reading!

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-include-cleanerenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions