Mercurial > projects > ldc
comparison druntime/import/core/stdc/stdarg.d @ 1458:e0b2d67cfe7c
Added druntime (this should be removed once it works).
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 02 Jun 2009 17:43:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1456:7b218ec1044f | 1458:e0b2d67cfe7c |
---|---|
1 /** | |
2 * D header file for C99. | |
3 * | |
4 * Copyright: Copyright Sean Kelly 2005 - 2009. | |
5 * License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>. | |
6 * Authors: Sean Kelly | |
7 * Standards: ISO/IEC 9899:1999 (E) | |
8 * | |
9 * Copyright Sean Kelly 2005 - 2009. | |
10 * Distributed under the Boost Software License, Version 1.0. | |
11 * (See accompanying file LICENSE_1_0.txt or copy at | |
12 * http://www.boost.org/LICENSE_1_0.txt) | |
13 */ | |
14 module core.stdc.stdarg; | |
15 | |
16 | |
17 alias void* va_list; | |
18 | |
19 template va_start( T ) | |
20 { | |
21 void va_start( out va_list ap, inout T parmn ) | |
22 { | |
23 ap = cast(va_list) ( cast(void*) &parmn + ( ( T.sizeof + int.sizeof - 1 ) & ~( int.sizeof - 1 ) ) ); | |
24 } | |
25 } | |
26 | |
27 template va_arg( T ) | |
28 { | |
29 T va_arg( inout va_list ap ) | |
30 { | |
31 T arg = *cast(T*) ap; | |
32 ap = cast(va_list) ( cast(void*) ap + ( ( T.sizeof + int.sizeof - 1 ) & ~( int.sizeof - 1 ) ) ); | |
33 return arg; | |
34 } | |
35 } | |
36 | |
37 void va_end( va_list ap ) | |
38 { | |
39 | |
40 } | |
41 | |
42 void va_copy( out va_list dest, va_list src ) | |
43 { | |
44 dest = src; | |
45 } |