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

Commit

Permalink
use __traits(externDmangle) if supported by compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
rainers committed May 27, 2017
1 parent f7378d4 commit 68f59ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/internal/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ private template substInoutForm(T)
/// used to declare an extern(D) function that is defined in a different module
template externDFunc(string fqn, T:FT*, FT) if(is(FT == function))
{
static if (is(FT RT == return) && is(FT Args == function))
static if (__traits(compiles, __traits(foo, void function())))
{
alias _wrap(alias T) = T; // fool the parser
alias externDFunc = _wrap!(__traits(externDmangle, fqn, FT));
}
else static if (is(FT RT == return) && is(FT Args == function))
{
import core.demangle : mangleFunc;
enum decl = {
Expand Down

0 comments on commit 68f59ed

Please sign in to comment.