digitalmars.D.ldc - C++ binding issues with "overloading" pragma mangle
- ParticlePeter (13/13) Jun 22 2017 Using DMD I can "overload" extern C++ function signatures, but
- David Nadlinger via digitalmars-d-ldc (4/6) Jun 22 2017 It is merely a precaution – the requirement could be removed by having...
- ParticlePeter (2/9) Jun 22 2017 Thanks, I'll post an issue on github and link this thread.
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?
Jun 22 2017
On 22 Jun 2017, at 15:53, ParticlePeter via digitalmars-d-ldc wrote:Is this some precaution or is unique mangling really necessary? If not, could this requirement be removed?It is merely a precaution – the requirement could be removed by having LDC insert bitcasts as appropriate on the LLVM IR level. — David
Jun 22 2017
On Thursday, 22 June 2017 at 15:03:05 UTC, David Nadlinger wrote:On 22 Jun 2017, at 15:53, ParticlePeter via digitalmars-d-ldc wrote:Thanks, I'll post an issue on github and link this thread.Is this some precaution or is unique mangling really necessary? If not, could this requirement be removed?It is merely a precaution – the requirement could be removed by having LDC insert bitcasts as appropriate on the LLVM IR level. — David
Jun 22 2017