]> git.lyx.org Git - lyx.git/blobdiff - src/support/debugstream.h
make "make distcheck" work
[lyx.git] / src / support / debugstream.h
index 9619720f6b49f1d46a06fe5798735f7f62adfb70..c41d4d94b175988c6c2dfff91fe5e68ca6e45fe4 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 /**
- * \file debugStream.h
+ * \file debugstream.h
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
 #ifndef DEBUG_STREAM_HPP
 #define DEBUG_STREAM_HPP
 
+#include <iostream>
+
 #include <boost/test/detail/nullstream.hpp>
 
+#ifdef DEBUG
+# define TEMPORARY_DEBUG_MACRO DEBUG
+# undef DEBUG
+#endif
 
 struct debug_trait {
        enum type {
@@ -34,6 +40,11 @@ struct debug_trait {
        }
 };
 
+#ifdef TEMPORARY_DEBUG_MACRO
+# define DEBUG TEMPORARY_DEBUG_MACRO
+# undef TEMPORARY_DEBUG_MACRO
+#endif
+
 
 template <class dtrait,
          class charT = char,
@@ -43,6 +54,10 @@ public:
        typedef dtrait debug;
        typedef typename debug::type Type;
 
+       basic_debugstream()
+               : std::basic_ostream<charT, traits>(0), dt(debug::NONE)
+       {}
+
        /// Constructor, sets the debug level to t.
        explicit basic_debugstream(std::basic_streambuf<charT, traits> * buf)
                : std::basic_ostream<charT, traits>(buf), dt(debug::NONE)