]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/global-ctor.hh
release: 1.1.28
[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 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef GLOBAL_CTOR_HH
11 #define GLOBAL_CTOR_HH
12
13
14 #define ADD_GLOBAL_CTOR_WITHNAME(y,x)\
15 class Global_ctor_ ## y  \
16 {\
17 public: \
18   Global_ctor_ ## y () {                \
19     add_constructor (x);        \
20   }                             \
21 }  _ ## y ## _ctor_init;        \
22
23
24 #define ADD_GLOBAL_CTOR(x) ADD_GLOBAL_CTOR_WITHNAME(x,x);
25
26
27 typedef void (* Global_ctor ) ();
28 void add_constructor (Global_ctor ctor);
29 void call_constructors ();
30
31 #endif /* GLOBAL_CTOR_HH */
32