Mercurial > projects > ldc
annotate lphobos/std/stdarg.d @ 837:331a176c1f4f
Removed error on naked, not fully complete, but I'll be doing more work on it during this Christmas, and some things do work.
Fixed taking delegate of final class method. see mini/delegate3.d.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 09 Dec 2008 14:07:30 +0100 |
parents | eef8ac26c66c |
children |
rev | line source |
---|---|
65 | 1 |
2 /* | |
3 * Placed in public domain. | |
4 * Written by Hauke Duden and Walter Bright | |
5 */ | |
6 | |
7 /* This is for use with variable argument lists with extern(D) linkage. */ | |
8 | |
664
eef8ac26c66c
Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents:
131
diff
changeset
|
9 /* Modified for LDC (LLVM D Compiler) by Tomas Lindquist Olsen, 2007 */ |
131 | 10 |
65 | 11 module std.stdarg; |
12 | |
13 alias void* va_list; | |
14 | |
131 | 15 T va_arg(T)(ref va_list vp) |
65 | 16 { |
131 | 17 size_t size = T.sizeof > size_t.sizeof ? size_t.sizeof : T.sizeof; |
18 va_list vptmp = cast(va_list)((cast(size_t)vp + size - 1) & ~(size - 1)); | |
70
fb265a6efea1
[svn r74] Fixed passing types with different alignment to D-style variadic functions.
lindquist
parents:
65
diff
changeset
|
19 vp = vptmp + T.sizeof; |
65 | 20 return *cast(T*)vptmp; |
21 } |