interfacing Cpp - GCC Dual ABI abi_tag in name mangling

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 30 04:35:54 PDT 2017


On 2017-04-29 20:08, سليمان السهمي (Soulaïman Sahmi) wrote:
> GCC has this attribute called abi_tag that they put on any function that
> returns std::string or std::list, for the rational behind that read
> here:https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html .
> the special thing with this attribute is that it adds something to the
> name mangling of your function, and I don't know how to represent that
> in D.
> for example the cpp function "std::string func()" will be mangled as
> "func[abi:cxx11]()".
> any ideas?

You can use pragma(mangle, "some mangling"); to set the mangled name of 
a symbol.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list