From: helly Date: Sun, 26 Feb 2006 20:30:54 +0000 (+0000) Subject: - Small tweaks to allow build with Sun compiler using stlport4 X-Git-Tag: 0.13.6~446 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4722b6ece2ca2cd29f642ac5732cc82c3833cb6;p=re2c - Small tweaks to allow build with Sun compiler using stlport4 --- diff --git a/stream_lc.h b/stream_lc.h index 5eb2cbdd..f260f2dd 100755 --- a/stream_lc.h +++ b/stream_lc.h @@ -10,6 +10,7 @@ #include #include #include +#include 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(); diff --git a/substr.cc b/substr.cc index 0a5d87f3..771a925f 100644 --- a/substr.cc +++ b/substr.cc @@ -1,5 +1,6 @@ /* $Id$ */ #include +#include #include "substr.h" #include "globals.h"