Mercurial > projects > ldc
annotate lphobos/std/stdarg.d @ 1650:40bd4a0d4870
Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).
Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.
Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
author | Tomas Lindquist Olsen |
---|---|
date | Wed, 19 May 2010 12:42:32 +0200 |
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 } |