comparison lphobos/internal/moduleinit.d @ 1:c53b6e3fe49a trunk

[svn r5] Initial commit. Most things are very rough.
author lindquist
date Sat, 01 Sep 2007 21:43:27 +0200
parents
children
comparison
equal deleted inserted replaced
0:a9e71648e74d 1:c53b6e3fe49a
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 }