view dmd/codegen/linkhelper.d @ 157:b7b61140701d

* added all missing default cases in switch statements + Lexer.getDocComment + Lexer.combineComments
author trass3r
date Thu, 16 Sep 2010 01:34:10 +0200
parents 31c086f76669
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));
	}
}