]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/debug.cc
release: 0.1.65
[lilypond.git] / lily / debug.cc
index 39b40c77641298d113f3c785c62e0596cbbf9209..8fcb8eba4bf9bd09e46cf2e9d202d1f18eb74040 100644 (file)
@@ -6,15 +6,17 @@
   (c) 1996,98 Han-Wen Nienhuys <hanwen@stack.nl>
   
  */
-#include <malloc.h>
 #include <fstream.h>
 #include <signal.h>
-#include <std/new.h>
+
+// libg++ 2.8.0
+// #include <std/new.h>
 #include <stdlib.h>
 #include "debug.hh"
 #include "dstream.hh"
 #include "flower-debug.hh"
 #include "moment.hh"
+
 #include "main.hh"
 Dstream *monitor=0;
 ostream * nulldev =0;
@@ -52,15 +54,13 @@ float_handler (int)
   assert (false);
 }
 
-/// just to make sure print_rat is linked in
-static void (*rat_printer)(Moment const&);
 
 void
 debug_init()
 {
-  rat_printer = print_rat;
 #ifndef NDEBUG
-  set_new_handler (&mynewhandler);
+  // libg++ 2.8.0 doesn't have set_new_handler
+  // set_new_handler (&mynewhandler);
 #endif
   set_flower_debug (*monitor, check_debug);
 
@@ -72,10 +72,11 @@ bool check_debug=false;
 
 bool check_malloc_b = false;
 
-// #define MEMORY_PARANOID
+//#define MEMORY_PARANOID
 
 #ifdef MEMORY_PARANOID
 
+#include <malloc.h>
 
 void *
 operator new (size_t size)
@@ -106,5 +107,10 @@ set_debug (bool b)
   check_debug =b;
   set_flower_debug (*monitor, check_debug);
   check_malloc_b = experimental_features_global_b;
+#ifdef MEMORY_PARANOID
+  if (check_malloc_b)
+    if (mcheck (0))
+      warning ("Can't set mem-checking!");
+#endif
 }