]> git.donarmstrong.com Git - lilypond.git/blob - lily/global-ctor.cc
Run `make grand-replace'.
[lilypond.git] / lily / global-ctor.cc
1 /*
2   global-ctor.cc -- implement global constructors
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "global-ctor.hh"
10
11 #include "std-vector.hh"
12
13 static vector<Global_ctor> *ctor_global_statics_;
14
15 void
16 add_constructor (Global_ctor c)
17 {
18   if (!ctor_global_statics_)
19     ctor_global_statics_ = new vector<Global_ctor>;
20   ctor_global_statics_->push_back (c);
21 }
22
23 void
24 call_constructors ()
25 {
26   for (vsize i = 0; i < ctor_global_statics_->size (); i++)
27     (ctor_global_statics_->at (i)) ();
28 }