comparison tango/tango/stdc/stdarg.d @ 132:1700239cab2e trunk

[svn r136] MAJOR UNSTABLE UPDATE!!! Initial commit after moving to Tango instead of Phobos. Lots of bugfixes... This build is not suitable for most things.
author lindquist
date Fri, 11 Jan 2008 17:57:40 +0100
parents
children a27941d00351
comparison
equal deleted inserted replaced
131:5825d48b27d1 132:1700239cab2e
1 /**
2 * D header file for C99.
3 *
4 * Copyright: Public Domain
5 * License: Public Domain
6 * Authors: Hauke Duden, Walter Bright
7 * Standards: ISO/IEC 9899:1999 (E)
8 */
9 module tango.stdc.stdarg;
10
11
12 version( GNU )
13 {
14 public import std.c.stdarg;
15 }
16 else
17 {
18 alias void* va_list;
19
20 template va_start( T )
21 {
22 void va_start( out va_list ap, inout T parmn )
23 {
24 ap = cast(va_list) ( cast(void*) &parmn + ( ( T.sizeof + int.sizeof - 1 ) & ~( int.sizeof - 1 ) ) );
25 }
26 }
27
28 template va_arg( T )
29 {
30 T va_arg( inout va_list ap )
31 {
32 T arg = *cast(T*) ap;
33 ap = cast(va_list) ( cast(void*) ap + ( ( T.sizeof + int.sizeof - 1 ) & ~( int.sizeof - 1 ) ) );
34 return arg;
35 }
36 }
37
38 void va_end( va_list ap )
39 {
40
41 }
42
43 void va_copy( out va_list dest, va_list src )
44 {
45 dest = src;
46 }
47 }