On Friday, 10 August 2018 at 12:05:52 UTC, Simen Kjærås wrote:
On Friday, 10 August 2018 at 11:17:10 UTC, learnfirst1 wrote:
If you try the same without the mixin template, you'll see that
it doesn't work:
struct Test {
extern(C) pragma(crt_constructor) static void init(){ // work
On Friday, 10 August 2018 at 11:17:10 UTC, learnfirst1 wrote:
I think the static extern(C) nested function should just work
like global extern(C) function. DMD still report missing
symbols. Or I am wrong about this ?
template G(){
static extern(C) pragma(crt_constructor) void init(){}
On Friday, 10 August 2018 at 10:24:55 UTC, Simen Kjærås wrote:
On Friday, 10 August 2018 at 08:31:21 UTC, learnfirst1 wrote:
Filed a bug:
https://issues.dlang.org/show_bug.cgi?id=19153
template G(){
pragma(crt_constructor) static extern(C) void init(){}
}
void main(){
mixin G!(); // Li
On Friday, 10 August 2018 at 10:24:55 UTC, Simen Kjærås wrote:
On Friday, 10 August 2018 at 08:31:21 UTC, learnfirst1 wrote:
The correct behavior would be for the compiler to show the
latter error message for a mixin'd function as well.
Filed a bug:
https://issues.dlang.org/show_bug.cgi?id=191
On Friday, 10 August 2018 at 08:31:21 UTC, learnfirst1 wrote:
#!/usr/bin/env rdmd
import core.stdc.stdio;
template G(size_t line = __LINE__, A...){
int i = 3;
static extern(C) pragma(crt_constructor) void init2(){
printf("init: %d\n", line);
}
}
pragma(c
#!/usr/bin/env rdmd
import core.stdc.stdio;
template G(size_t line = __LINE__, A...){
int i = 3;
static extern(C) pragma(crt_constructor) void init2(){
printf("init: %d\n", line);
}
}
pragma(crt_constructor) extern(C) void init1(){
printf("init fro