wrapit icon indicating copy to clipboard operation
wrapit copied to clipboard

Add support for enum "C"

Open giannishatzo opened this issue 2 years ago • 2 comments

I'm trying to wrap a library which includes both C and C++ header files. Is there a way to make this configuration work with wrapit? C headers are embedded in an extern "C" {} structure, but when trying to run wrapit on it, the result is 0 enums, classes, etc.

giannishatzo avatar Feb 17 '23 20:02 giannishatzo

Hello Giannis,

You can wrap such libraries with the current version, by removing the extern "C" from the headers passed to WrapIt. Once the code generated, you should use the original header files to compile it.

The direct support for extern "C" may eventually be added. The libclang library used to parse the c++ code does not seem to support this directive making the implementation more difficult that it should.

Philippe.

grasph avatar Feb 20 '23 14:02 grasph

Hi Philippe

Thanks a lot, this sounds promising. I'll give it a try as soon as I find the time and I'll let you know.

Giannis

giannishatzo avatar Feb 20 '23 18:02 giannishatzo