X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fdebug.h;h=b98dfd0eab5fe988e75121907bd4045b04d75873;hb=c0000cc405063044fb4eca3f04ab35f69fe3dd74;hp=3835242b366f7e3e34e35f4ce9fd530857afeb80;hpb=0a48051f27e88ac7477ca5f3752c5ac2e6bf992a;p=lyx.git diff --git a/src/support/debug.h b/src/support/debug.h index 3835242b36..b98dfd0eab 100644 --- a/src/support/debug.h +++ b/src/support/debug.h @@ -17,6 +17,10 @@ #include "support/strfwd.h" +// Forward definitions do not work with libc++ +// but ios_base has already been defined in strfwd +// if compiling with it +#ifndef USE_LLVM_LIBCPP namespace std { class ios_base; @@ -25,6 +29,7 @@ template class basic_streambuf; typedef basic_streambuf > streambuf; } +#endif namespace lyx { @@ -76,7 +81,7 @@ namespace Debug { /// WORKAREA = (1 << 19), /// - INSETTEXT = (1 << 20), + CLIPBOARD = (1 << 20), /// GRAPHICS = (1 << 21), /// change tracking @@ -124,8 +129,6 @@ namespace Debug { /// Show all the possible tags that can be used for debugging void showTags(std::ostream & os); - /// Print simple callstack to stderr - void printCallStack(); } // namespace Debug @@ -139,7 +142,8 @@ inline void operator|=(Debug::Type & d1, Debug::Type d2) class LyXErr { public: - LyXErr(): enabled_(true), second_enabled_(false) {} + LyXErr(): dt_(Debug::NONE), stream_(0), enabled_(true), + second_stream_(0), second_enabled_(false) {} /// Disable the stream completely void disable(); @@ -159,7 +163,7 @@ public: bool enabled() const { return enabled_; } /// Returns second stream - std::ostream & secondStream() { return *second_stream_; }; + std::ostream & secondStream() { return *second_stream_; } /// Sets second stream void setSecondStream(std::ostream * os) { second_enabled_ = (second_stream_ = os); } @@ -173,6 +177,9 @@ public: /// Returns true if t is part of the current debug level bool debugging(Debug::Type t = Debug::ANY) const; + /// + static char const * stripName(char const *); + private: /// The current debug level Debug::Type dt_; @@ -195,6 +202,10 @@ LyXErr & operator<<(LyXErr &, int); LyXErr & operator<<(LyXErr &, unsigned int); LyXErr & operator<<(LyXErr &, long); LyXErr & operator<<(LyXErr &, unsigned long); +#ifdef LYX_USE_LONG_LONG +LyXErr & operator<<(LyXErr &, long long); +LyXErr & operator<<(LyXErr &, unsigned long long); +#endif LyXErr & operator<<(LyXErr &, double); LyXErr & operator<<(LyXErr &, std::string const &); LyXErr & operator<<(LyXErr &, docstring const &); @@ -210,7 +221,7 @@ extern LyXErr lyxerr; # include # define CURRENT_POSITION BOOST_CURRENT_FUNCTION ": " #else -# define CURRENT_POSITION __FILE__ << "(" << __LINE__ << "): " +# define CURRENT_POSITION lyx::LyXErr::stripName(__FILE__) << " (" << __LINE__ << "): " #endif #define LYXERR(type, msg) \