view dmd/codegen/linkhelper.d @ 140:31c086f76669

dmd.lib now only contains the backend backward references from the backend to the frontend are implemented in ddmd win32_lib.mak is replaced by a patch also fixed VisualD project file predefined versions
author Trass3r
date Tue, 14 Sep 2010 01:54:48 +0200
parents
children b7b61140701d
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 {}
	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));
	}
}