mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 17:13:20 +01:00
Created separate tests directory for D1.
This commit is contained in:
30
tests/d1/testincludes/std/stdarg.d
Normal file
30
tests/d1/testincludes/std/stdarg.d
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user