]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/engraver.cc
Issue 2787: Sanitize usage of -DDEBUG, -DNDEBUG and assert
[lilypond.git] / lily / engraver.cc
index fd352d836db951c14f13899691dd79eba2a7347e..76e1ef6f58b8214419cd9b422369480a8ace2fa4 100644 (file)
@@ -86,7 +86,7 @@ Engraver::Engraver ()
 {
 }
 
-#ifndef NDEBUG
+#ifdef DEBUG
 static SCM creation_callback = SCM_EOL;
 LY_DEFINE (ly_set_grob_creation_callback, "ly:set-grob-creation-callback",
            1, 0, 0, (SCM cb),
@@ -112,7 +112,7 @@ Engraver::internal_make_grob (SCM symbol,
                               int line,
                               char const *fun)
 {
-#ifdef NDEBUG
+#ifndef DEBUG
   (void)file;
   (void)line;
   (void)fun;
@@ -135,7 +135,7 @@ Engraver::internal_make_grob (SCM symbol,
   assert (grob);
   announce_grob (grob, cause);
 
-#ifndef NDEBUG
+#ifdef DEBUG
   if (ly_is_procedure (creation_callback))
     scm_apply_0 (creation_callback,
                  scm_list_n (grob->self_scm (), scm_from_utf8_string (file),