]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/global-ctor.hh
7b10975331a167956880bb6015b5215a4f405606
[lilypond.git] / lily / include / global-ctor.hh
1 /*
2   global-ctor.hh -- declare Global construction stuff.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef GLOBAL_CTOR_HH
10 #define GLOBAL_CTOR_HH
11
12 #define ADD_GLOBAL_CTOR_WITHNAME(y, x)          \
13   class Global_ctor_ ## y                       \
14   {                                             \
15   public:                                       \
16     Global_ctor_ ## y ()                        \
17       {                                         \
18         add_constructor (x);                    \
19       }                                         \
20   }                                             \
21     _ ## y ## _ctor_init;
22
23 #define ADD_GLOBAL_CTOR(x) ADD_GLOBAL_CTOR_WITHNAME (x, x);
24
25 typedef void (* Global_ctor) ();
26 void add_constructor (Global_ctor ctor);
27 void call_constructors ();
28
29 #endif /* GLOBAL_CTOR_HH */
30