1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
$NetBSD: patch-bu,v 1.1 2005/03/06 11:40:21 spz Exp $
--- src/gnug++/BitSet.cc.orig 2004-07-30 12:58:11.000000000 +0200
+++ src/gnug++/BitSet.cc
@@ -30,7 +30,11 @@ Foundation, 59 Temple Place - Suite 330,
#include <new>
#include <builtin.h>
#include <string>
+#if (__GNUC__ > 2)
#include <sstream>
+#else
+#include <strstream.h>
+#endif
using namespace std;
@@ -895,8 +899,11 @@ const char* BitSettoa(const BitSet& x, c
trim(x.rep);
int wrksiz = (x.rep->len + 1) * BITSETBITS + 2;
char* fmtbase = (char *) _libgxx_fmtq.alloc(wrksiz);
- //ostrstream stream(fmtbase, wrksiz);
+#if (__GNUC__ > 2)
std::ostringstream stream(fmtbase, ios_base::out | ios_base::trunc);
+#else
+ ostrstream stream(fmtbase, wrksiz);
+#endif
x.printon(stream, f, t, star);
stream << ends;
@@ -1043,11 +1050,17 @@ BitSet atoBitSet(const char* s, char f,
ostream& operator<<(ostream& s, const BitSet& x)
{
+#if (__GNUC__ > 2)
ostream::sentry opfx(s);
if (opfx) {
x.printon(s);
}
+#else
+ if (s.opfx()) {
+ x.printon(s);
+ }
+#endif
return s;
}
|