]> git.donarmstrong.com Git - lilypond.git/commit - lily/lily-guile.cc
Issue 4376: Add LY_ASSERT_DERIVED_SMOB macro
authorDavid Kastrup <dak@gnu.org>
Wed, 6 May 2015 22:30:18 +0000 (00:30 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 12 May 2015 12:23:43 +0000 (14:23 +0200)
commitb882256ddb159e7169a30052f0c9fb2999f83b7a
treea9aae83fec1b8afee0fa15a8a6ace61a03801fc1
parent3c5b5ffb8dc8bdb3295e6105afd18afeb85a9d88
Issue 4376: Add LY_ASSERT_DERIVED_SMOB macro

When LY_ASSERT_SMOB is called with a class that is actually derived from
some smobified base class providing is_smob and unsmob, the resulting
check and error message are inaccurate.  This patch uses dynamic_cast to
implement a separate LY_ASSERT_DERIVED_SMOB attaining sensible behavior
in that case.  When no derivation is involved, the performance impact is
minimal.
lily/include/lily-guile-macros.hh
lily/lily-guile.cc