From d2a5221f4a9c46778bfcf7988e75a52a4fc2a6b1 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 28 Nov 2000 01:46:01 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/express/multiplexStreamBuf.cxx | 15 ++++++++++++--- panda/src/express/trueClock.cxx | 4 +--- panda/src/putil/lineStreamBuf.I | 2 +- panda/src/putil/lineStreamBuf.cxx | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/panda/src/express/multiplexStreamBuf.cxx b/panda/src/express/multiplexStreamBuf.cxx index d596b6e447..7fa9556087 100644 --- a/panda/src/express/multiplexStreamBuf.cxx +++ b/panda/src/express/multiplexStreamBuf.cxx @@ -10,13 +10,19 @@ // risk infinite recursion. #include +#if defined(WIN32_VC) +#define WINDOWS_LEAN_AND_MEAN +#include +#undef WINDOWS_LEAN_AND_MEAN +#endif + #ifndef HAVE_STREAMSIZE // Some compilers--notably SGI--don't define this for us. typedef int streamsize; #endif //////////////////////////////////////////////////////////////////// -// Function: MultiplexStreamBuf::Output::wrinte_string +// Function: MultiplexStreamBuf::Output::write_string // Access: Public // Description: Dumps the indicated string to the appropriate place. //////////////////////////////////////////////////////////////////// @@ -29,12 +35,13 @@ write_string(const string &str) { break; case OT_system_debug: +#ifdef WIN32_VC + OutputDebugString(str.c_str()); +#endif break; } } -static char test[1024]; - //////////////////////////////////////////////////////////////////// // Function: MultiplexStreamBuf::Constructor // Access: Public @@ -43,6 +50,8 @@ static char test[1024]; MultiplexStreamBuf:: MultiplexStreamBuf() { #ifndef WIN32_VC + // These lines, which are essential on Irix and Linux, seem to be + // unnecessary and not understood on Windows. allocate(); setp(base(), ebuf()); #endif diff --git a/panda/src/express/trueClock.cxx b/panda/src/express/trueClock.cxx index 4e34f52bc5..825ccfea88 100644 --- a/panda/src/express/trueClock.cxx +++ b/panda/src/express/trueClock.cxx @@ -9,7 +9,6 @@ TrueClock *TrueClock::_global_ptr = NULL; - #if defined(WIN32_VC) //////////////////////////////////////////////////////////////////// @@ -78,7 +77,6 @@ TrueClock() { } - #elif defined(PENV_PS2) //////////////////////////////////////////////////////////////////// @@ -135,7 +133,7 @@ TrueClock() { } -#else +#elif !defined(WIN32_VC) //////////////////////////////////////////////////////////////////// // diff --git a/panda/src/putil/lineStreamBuf.I b/panda/src/putil/lineStreamBuf.I index f64be57b34..6289bf9933 100644 --- a/panda/src/putil/lineStreamBuf.I +++ b/panda/src/putil/lineStreamBuf.I @@ -36,7 +36,7 @@ has_newline() const { //////////////////////////////////////////////////////////////////// // Function: LineStreamBuf::write_chars -// Access: Public +// Access: Private // Description: An internal function called by sync() and overflow() // to store one or more characters written to the stream // into the memory buffer. diff --git a/panda/src/putil/lineStreamBuf.cxx b/panda/src/putil/lineStreamBuf.cxx index 077500c701..20f7a4c065 100644 --- a/panda/src/putil/lineStreamBuf.cxx +++ b/panda/src/putil/lineStreamBuf.cxx @@ -58,6 +58,7 @@ int LineStreamBuf:: sync() { streamsize n = pptr() - pbase(); write_chars(pbase(), n); + pbump(-n); // Reset pptr(). return 0; // EOF to indicate write full. } @@ -81,6 +82,5 @@ overflow(int ch) { write_chars(&c, 1); } - pbump(-n); // Reset pptr(). return 0; }