mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00
31 lines
524 B
D
31 lines
524 B
D
|
|
/*
|
|
* Placed in public domain.
|
|
* Written by Hauke Duden and Walter Bright
|
|
*/
|
|
|
|
module std.c.stdarg;
|
|
|
|
typedef void* va_list;
|
|
|
|
template va_start(T)
|
|
{
|
|
void va_start(out va_list ap, inout T parmn)
|
|
{
|
|
ap = cast(va_list)(cast(void*)&parmn + ((T.sizeof + int.sizeof - 1) & ~(int.sizeof - 1)));
|
|
}
|
|
}
|
|
|
|
template va_arg(T)
|
|
{
|
|
T va_arg(inout va_list ap)
|
|
{
|
|
T arg = *cast(T*)ap;
|
|
ap = cast(va_list)(cast(void*)ap + ((T.sizeof + int.sizeof - 1) & ~(int.sizeof - 1)));
|
|
return arg;
|
|
}
|
|
}
|
|
|
|
void va_end(va_list ap)
|
|
{
|
|
}
|