]> git.lyx.org Git - lyx.git/blobdiff - src/support/debugstream.h
hopefully fix tex2lyx linking.
[lyx.git] / src / support / debugstream.h
index b4f32cba7739d469f33e51124a437d3d924c07f5..b5e9283f7e165e9eb674f16a7f9c082028bd4d57 100644 (file)
 
 #include <iostream>
 
-#include <boost/test/detail/nullstream.hpp>
+#include <boost/version.hpp>
+
+
+//namespace lyx {
+
+#if BOOST_VERSION < 103300
+#  include <boost/test/detail/nullstream.hpp>
+#else
+#  include <boost/test/utils/nullstream.hpp>
+#endif
+
+#ifdef DEBUG
+# define TEMPORARY_DEBUG_MACRO DEBUG
+# undef DEBUG
+#endif
 
 struct debug_trait {
        enum type {
@@ -35,6 +49,11 @@ struct debug_trait {
        }
 };
 
+#ifdef TEMPORARY_DEBUG_MACRO
+# define DEBUG TEMPORARY_DEBUG_MACRO
+# undef TEMPORARY_DEBUG_MACRO
+#endif
+
 
 template <class dtrait,
          class charT = char,
@@ -44,6 +63,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)
@@ -85,4 +108,7 @@ private:
 
 typedef basic_debugstream<debug_trait> debugstream;
 
+
+//} // namespace lyx
+
 #endif