Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit c14e7db

Browse files
authored
Merge pull request #1835 from rainers/mangleof_to_traits
use __traits(getLinkage) instead of mangleof to determine linkage merged-on-behalf-of: Martin Nowak <code@dawg.eu>
2 parents 144c9e6 + 5a817fb commit c14e7db

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/core/demangle.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,19 +1862,19 @@ unittest
18621862

18631863
private template isExternD(FT) if (is(FT == function))
18641864
{
1865-
enum isExternD = FT.mangleof[0] == 'F';
1865+
enum isExternD = __traits(getLinkage, FT) == "D";
18661866
}
18671867

18681868
private template isExternCPP(FT) if (is(FT == function))
18691869
{
1870-
enum isExternCPP = FT.mangleof[0] == 'R';
1870+
enum isExternCPP = __traits(getLinkage, FT) == "C++";
18711871
}
18721872

18731873
private template hasPlainMangling(FT) if (is(FT == function))
18741874
{
1875-
enum c = FT.mangleof[0];
1875+
enum lnk = __traits(getLinkage, FT);
18761876
// C || Pascal || Windows
1877-
enum hasPlainMangling = c == 'U' || c == 'V' || c == 'W';
1877+
enum hasPlainMangling = lnk == "C" || lnk == "Pascal" || lnk == "Windows";
18781878
}
18791879

18801880
unittest

0 commit comments

Comments
 (0)