]> granicus.if.org Git - re2c/commitdiff
- Small tweaks to allow build with Sun compiler using stlport4
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 26 Feb 2006 20:30:54 +0000 (20:30 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sun, 26 Feb 2006 20:30:54 +0000 (20:30 +0000)
stream_lc.h
substr.cc

index 5eb2cbdd782f44e6ca7248824b4f74563558cd9b..f260f2ddeb53ab8d778a76cfe60a533b52b5979e 100755 (executable)
@@ -10,6 +10,7 @@
 #include <iosfwd>
 #include <fstream>
 #include <assert.h>
+#include <stdio.h>
 
 namespace re2c
 {
@@ -219,6 +220,22 @@ protected:
                return c;
        }
 
+       virtual std::streamsize xsgetn(_E* buf, std::streamsize n)
+       {
+               std::streamsize r = 0;
+               while(n--)
+               {
+                       int_type c = underflow();
+                       if (_Tr::eq_int_type(_Tr::eof(), c))
+                       {
+                               break;
+                       }
+                       buf[r++] = c;
+               }
+               buf[r] = '\0';
+               return r;
+       }
+
        virtual pos_type seekoff(off_type off, std::ios_base::seekdir whence,
                std::ios_base::openmode = (std::ios_base::openmode)(std::ios_base::in | std::ios_base::out))
        {
@@ -246,7 +263,7 @@ protected:
                        || 0 <= fflush(fp) ? 0 : -1;
        }
 
-       std::streamsize xsputn(const _E *buf, std::streamsize cnt)
+       virtual std::streamsize xsputn(const _E *buf, std::streamsize cnt)
        {
                fwrite(buffer.c_str(), sizeof(_E), buffer.length(), fp);
                buffer.clear();
index 0a5d87f36ed325a9014cfac34abe985f35143da4..771a925f3c1873b8370fa43067cef9a237f04234 100644 (file)
--- a/substr.cc
+++ b/substr.cc
@@ -1,5 +1,6 @@
 /* $Id$ */
 #include <string.h>
+#include <stdlib.h>
 #include "substr.h"
 #include "globals.h"