try to avoid initailizaton problems with global debugstream variable.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8011 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-11-01 13:03:03 +00:00
parent 5f3e824d2c
commit d66e61a93c
5 changed files with 27 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2003-11-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* debug.C: only use the default constructor for debugstream
(lyxerr) here.
* main.C (main): include debug.h and setup the lyxerr streambuf
here.
2003-10-31 José Matos <jamatos@lyx.org>
* paragraph_funcs.C (addDepth, asciiParagraph): move from buffer.C

View File

@ -123,4 +123,4 @@ void lyx_debug_trait::showTags(ostream & os)
os.flush();
}
LyXErr lyxerr(std::cerr.rdbuf());
LyXErr lyxerr;

View File

@ -11,6 +11,7 @@
#include <config.h>
#include "debug.h"
#include "lyx_main.h"
#include "gettext.h"
#include "support/os.h"
@ -28,6 +29,10 @@ int main(int argc, char * argv[])
#ifdef HAVE_IOS
std::ios_base::sync_with_stdio(false);
#endif
// To avoid ordering of global object problems with some
// stdlibs we do the initialization here, but still as
// early as possible.
lyxerr.rdbuf(std::cerr.rdbuf());
os::init(&argc, &argv);

View File

@ -1,3 +1,8 @@
2003-11-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* debugstream.h: add a default constructor that does not setup a
streambuf here.
2003-10-14 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* socktools.C: honor CXX_GLOBAL_CSTD

View File

@ -44,6 +44,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)