From: fred Date: Sun, 24 Mar 2002 19:36:38 +0000 (+0000) Subject: lilypond-0.0.45 X-Git-Tag: release/1.5.59~5112 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=81de4a5a03bfb2a285471662c5f7b39eeb0612b6;p=lilypond.git lilypond-0.0.45 --- diff --git a/lily/include/class-name.hh b/lily/include/class-name.hh index 643959d620..14ebf4c927 100644 --- a/lily/include/class-name.hh +++ b/lily/include/class-name.hh @@ -10,10 +10,16 @@ #ifndef CLASS_NAME_HH #define CLASS_NAME_HH -/// a macro to declare the classes name as a static and virtual function. +/** a macro to declare the classes name as a static and virtual function. + The static_name() can *not* be inlined (this might have the effect that + s->name() != S::static_name(). Overlapping strings need not be merged in C++ + */ #define NAME_MEMBERS(c) \ -static char const *static_name(){ return #c; }\ +static char const *static_name();\ virtual char const *name() const{ return c::static_name(); } \ int a_stupid_nonexistent_function_to_allow_the_semicolon_come_out() + +#define IMPLEMENT_STATIC_NAME(c)\ + char const *c::static_name() { return #c; } #endif // CLASS-NAME_HH