Mercurial > projects > ldc
annotate lphobos/internal/moduleinit.d @ 55:0ccfae271c45 trunk
[svn r59] Added support for C-style variadic functions. Currently only works on x86, x86-64 va_arg is broken in LLVM 2.1. PPC and PPC64 unknown.
Updates to runtime. Rebuild!
author | lindquist |
---|---|
date | Wed, 24 Oct 2007 22:18:06 +0200 |
parents | c53b6e3fe49a |
children |
rev | line source |
---|---|
1 | 1 module internal.moduleinit; |
2 | |
3 private alias extern(C) void function() fptr_t; | |
4 | |
5 extern(C): | |
6 | |
7 fptr_t* _d_get_module_ctors(); | |
8 fptr_t* _d_get_module_dtors(); | |
9 | |
10 void _d_run_module_ctors() | |
11 { | |
12 auto p = _d_get_module_ctors(); | |
13 while(*p) { | |
14 (*p++)(); | |
15 } | |
16 } | |
17 | |
18 void _d_run_module_dtors() | |
19 { | |
20 auto p = _d_get_module_dtors(); | |
21 while(*p) { | |
22 (*p++)(); | |
23 } | |
24 } |