From 81de4a5a03bfb2a285471662c5f7b39eeb0612b6 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:36:38 +0000 Subject: [PATCH] lilypond-0.0.45 --- lily/include/class-name.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.5