Skip to content

Commit ffdab51

Browse files
committed
Merge pull request #2 from klickverbot/master
Temporary workaround for DMD bug 7127.
2 parents 1b23be1 + 0ce8488 commit ffdab51

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
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-
}

deimos/openssl/ssl.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ enum SSL_SESSION_CACHE_MAX_SIZE_DEFAULT = (1024*20);
693693
* supposed to be fixed at 16 bytes so the id will be padded after the callback
694694
* returns in this case. It is also an error for the callback to set the size to
695695
* zero. */
696-
alias ExternC!(int function(const(SSL)* ssl, ubyte* id,
696+
alias ExternC!(int function(/+ FIXME: @@BUG7127@@ const+/ SSL* ssl, ubyte* id,
697697
uint* id_len)) GEN_SESSION_CB;
698698

699699
struct ssl_comp_st {
@@ -1133,7 +1133,7 @@ version(OPENSSL_NO_COMP) {
11331133
* 1 fail if verify fails */
11341134
ExternC!(int function(int ok,X509_STORE_CTX* ctx)) verify_callback; /* fail if callback returns 0 */
11351135

1136-
ExternC!(void function(const(SSL)* ssl,int type,int val)) info_callback; /* optional informational callback */
1136+
ExternC!(void function(/+ FIXME: @@BUG7127@@ const+/ SSL* ssl,int type,int val)) info_callback; /* optional informational callback */
11371137

11381138
int error; /* error bytes to be written */
11391139
int error_code; /* actual code */

0 commit comments

Comments
 (0)