view dmd/codegen/linkhelper.d @ 168:ceed63f310fb

stringtable, stringbuffer and freelist moved to Global
author korDen
date Thu, 30 Sep 2010 12:57:13 +0400
parents b7b61140701d
children b64060ab22df
line wrap: on
line source

module dmd.codegen.linkhelper;

import dmd.Loc;
import dmd.Util;

import core.stdc.stdarg;
import std.conv;

// help resolve some linker dependencies from the backend back into the frontend

extern(C++)
{
	// msc.c wants to access global from out_config_init(), but it should never be called
	struct Global {}
	__gshared Global global;

	void error(const char *filename, uint linnum, const char *format, ...)
	{
		Loc loc;
		loc.filename = to!string(filename);
		loc.linnum = linnum;

		va_list ap;
		va_start(ap, format);
		
		char buf[1024];
		vsprintf(buf.ptr, format, ap);
		va_end( ap );
		
		dmd.Util.error(loc, to!string(buf));
	}
}