view tests/testincludes/std/stdarg.d @ 1596:42fc0d955a0d

Updated runtest to always rebuild libtangobos-partial.a in case of updates. Changed std.stdarg to import ldc.vararg so it has the correct implementation.
author Robert Clipsham <robert@octarineparrot.com>
date Sun, 15 Nov 2009 13:22:02 +0000
parents 628433c343b4
children
line wrap: on
line source


/*
 * Placed in public domain.
 * Written by Hauke Duden and Walter Bright
 */

/* This is for use with variable argument lists with extern(D) linkage. */

module std.stdarg;

version(LDC)
{
    public import ldc.vararg;
}
else
{

alias void* va_list;

template va_arg(T)
{
    T va_arg(inout va_list _argptr)
    {
	T arg = *cast(T*)_argptr;
	_argptr = _argptr + ((T.sizeof + int.sizeof - 1) & ~(int.sizeof - 1));
	return arg;
    }
}

}