Merge pull request #224 from jray272/run-windows-script
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>
Wed, 9 Aug 2017 06:04:26 +0000 (15:04 +0900)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2017 06:04:26 +0000 (15:04 +0900)
Run src/windows/preprocess.sh to pick up latest logging.h.in changes

CONTRIBUTORS
src/windows/glog/logging.h

index 70ddbec..7130683 100644 (file)
@@ -31,6 +31,7 @@ Fumitoshi Ukai <ukai@google.com>
 Guillaume Dumont <dumont.guillaume@gmail.com>
 HÃ¥kan L. S. Younes <hyounes@google.com>
 Ivan Penkov <ivanpe@google.com>
+Jim Ray <jimray@google.com>
 Michael Tanner <michael@tannertaxpro.com>
 MiniLight <MiniLightAR@Gmail.com>
 Peter Collingbourne <pcc@google.com>
index f521a2b..e72c088 100755 (executable)
@@ -1117,6 +1117,12 @@ class GOOGLE_GLOG_DLL_DECL LogStreamBuf : public std::streambuf {
   LogStreamBuf(char *buf, int len) {
     setp(buf, buf + len - 2);
   }
+
+  // Resets the buffer. Useful if we reuse it by means of TLS.
+  void reset() {
+     setp(pbase(), epptr());
+  }
+
   // This effectively ignores overflow.
   virtual int_type overflow(int_type ch) {
     return ch;
@@ -1179,6 +1185,7 @@ public:
     size_t pcount() const { return streambuf_.pcount(); }
     char* pbase() const { return streambuf_.pbase(); }
     char* str() const { return pbase(); }
+    void reset() { streambuf_.reset(); }
 
   private:
     LogStream(const LogStream&);