Thread overview | |||||
---|---|---|---|---|---|
|
June 22, 2017 C++ binding issues with "overloading" pragma mangle | ||||
---|---|---|---|---|
| ||||
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? |
June 22, 2017 Re: C++ binding issues with "overloading" pragma mangle | ||||
---|---|---|---|---|
| ||||
Posted in reply to ParticlePeter | 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
|
June 22, 2017 Re: C++ binding issues with "overloading" pragma mangle | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | 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:
>> 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
Thanks, I'll post an issue on github and link this thread.
|
Copyright © 1999-2021 by the D Language Foundation