Skip to content

Commit 514322d

Browse files
committed
Slimmed down ExternC.
1 parent 1b23be1 commit 514322d

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

deimos/openssl/_d_util.d

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,10 @@ package:
88
// Very boiled down version because we cannot use std.traits without causing
99
// DMD to create a ModuleInfo reference for _d_util, which would require users
1010
// to include the Deimos files in the build.
11-
12-
template ReturnType(T){
11+
template ExternC(T) if (is(typeof(*(T.init)) P == function)) {
1312
static if (is(typeof(*(T.init)) R == return)) {
14-
alias R ReturnType;
15-
}
16-
}
17-
18-
template ParameterTypeTuple(T) {
19-
static if (is(typeof(*(T.init)) P == function)) {
20-
alias P ParameterTypeTuple;
13+
static if (is(typeof(*(T.init)) P == function)) {
14+
alias extern(C) R function(P) ExternC;
15+
}
2116
}
2217
}
23-
24-
template ExternC(T) {
25-
alias extern(C) ReturnType!T function(ParameterTypeTuple!T) ExternC;
26-
}

0 commit comments

Comments
 (0)