140
|
1 module dmd.codegen.linkhelper;
|
|
2
|
|
3 import dmd.Loc;
|
|
4 import dmd.Util;
|
|
5
|
|
6 import core.stdc.stdarg;
|
|
7 import std.conv;
|
|
8
|
|
9 // help resolve some linker dependencies from the backend back into the frontend
|
|
10
|
|
11 extern(C++)
|
|
12 {
|
|
13 // msc.c wants to access global from out_config_init(), but it should never be called
|
|
14 struct Global {}
|
|
15 Global global;
|
|
16
|
|
17 void error(const char *filename, uint linnum, const char *format, ...)
|
|
18 {
|
|
19 Loc loc;
|
|
20 loc.filename = to!string(filename);
|
|
21 loc.linnum = linnum;
|
|
22
|
|
23 va_list ap;
|
|
24 va_start(ap, format);
|
|
25
|
|
26 char buf[1024];
|
|
27 vsprintf(buf.ptr, format, ap);
|
|
28 va_end( ap );
|
|
29
|
|
30 dmd.Util.error(loc, to!string(buf));
|
|
31 }
|
|
32 }
|