[CastXML] Windows __declspec(dllexport) in generated XML?

Mark Russell m.a.russell at me.com
Sun Aug 27 15:08:10 EDT 2017


I’ve started investigating castxml and pygccxml for use in generating C# and Swift based bindings for an in-house C++ library.  On the Windows side of course the C++ library makes use of __declspec(dllexport)/__declspec(dllimport) for controlling which C++ functions are exported from the library, and thus which functions are available for use within the bindings.  Sometimes it’s used at the class level, sometimes at the function level (depending on the need)

What I’m trying to figure out though is how the __declspec(dllexport) is reflected in the generated XML.  As far as I can tell, it currently does not end up in the output xml in any form.  Is there a clang/castxml command line argument that can be used to get this information in the final xml?

I can probably work around it if I had too, but it would be nice if the information somehow ended up in the final xml.

The command I’ve been using with my super simple test (and I have tried adding "-fms-extensions -fms-compatibility" into the mix, no joy):
castxml --castxml-output=1 --castxml-cc-msvc cl example.hpp

And my sample header file:

namespace Example
{
class __declspec(dllexport) MyExportedClass
{
public:
  const char* getDescription();
};
}


Thanks, 
Mark R


More information about the CastXML mailing list