You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix issue 18095 - Add support for pragma(mangle) on alias declarations
This allows to override the mangling of a type in an alias
declaration as follows:
```d
pragma(mangle, "foo") alias foo = int;
static assert(foo.mangleof == "foo");
static assert(int.mangleof == "i");
```
Overriding the mangling of a type in an alias allows for more generic
solution to get the correct mangling of `c_long/c_ulong` for C++
functions. With the current solution the compiler is looking for a
struct with the name `__c_long/__c_ulong` and special cases the
mangling for that particular struct. Since D doesn't have implicit
conversions to structs one are also forced cast/explicitly construct a
`__c_long` struct when calling a function which uses the `__c_long`
type as a parameter. With an alias that's not necessary anymore.
0 commit comments