C++ binding issues with "overloading" pragma mangle

ParticlePeter via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Jun 22 07:53:44 PDT 2017


Using DMD I can "overload" extern C++ function signatures, but 
this does not work with LDC:

C++ Function:
bool cppFunc( float[3] color );

D binding:
extern(C++):
pragma( mangel, cppFunc.mangleof ) bool cppFunc( ref float[3] 
color );
pragma( mangel, cppFunc.mangleof ) bool cppFunc( float* color );

LDC Error: Function type does not match previously declared 
function with the same mangled name: cppFunc.mangleof

Is this some precaution or is unique mangling really necessary? 
If not, could this requirement be removed?




More information about the digitalmars-d-ldc mailing list