openbsd-ports/devel/mico/patches/patch-orb_util_cc
espie 379f54390a make it build with gcc3.
Mostly work from Aleksander Piotrowski
2004-09-26 12:11:00 +00:00

115 lines
2.1 KiB
Plaintext

$OpenBSD: patch-orb_util_cc,v 1.1 2004/09/26 12:11:00 espie Exp $
--- orb/util.cc.orig Sun Sep 2 20:22:03 2001
+++ orb/util.cc Sun Aug 15 19:41:37 2004
@@ -27,9 +27,9 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
-#include <iostream.h>
-#include <fstream.h>
-#include <strstream.h>
+#include <iostream>
+#include <fstream>
+#include <sstream>
#include <mico/impl.h>
#include <mico/template_impl.h>
#include <mico/util.h>
@@ -95,76 +95,57 @@ xstrerror (int err)
string
xdec (int i)
{
- ostrstream ostr;
- ostr << i << ends;
-
- string s = ostr.str();
- ostr.rdbuf()->freeze (0);
- return s;
+ ostringstream ostr;
+ ostr << i;
+ return ostr.str();
}
string
xdec (long i)
{
- ostrstream ostr;
- ostr << i << ends;
-
- string s = ostr.str();
- ostr.rdbuf()->freeze (0);
- return s;
+ ostringstream ostr;
+ ostr << i;
+ return ostr.str();
}
string
xdec (OSMisc::longlong i)
{
- ostrstream ostr;
+ ostringstream ostr;
#if defined(_WINDOWS) && !defined(__MINGW32__)
- ostr << long(i) << ends; //XXX
+ ostr << long(i);
#else
- ostr << i << ends;
+ ostr << i;
#endif
-
- string s = ostr.str();
- ostr.rdbuf()->freeze (0);
- return s;
+ return ostr.str();
}
string
xdec (unsigned int i)
{
- ostrstream ostr;
- ostr << i << ends;
-
- string s = ostr.str();
- ostr.rdbuf()->freeze (0);
- return s;
+ ostringstream ostr;
+ ostr << i;
+ return ostr.str();
}
string
xdec (unsigned long i)
{
- ostrstream ostr;
- ostr << i << ends;
-
- string s = ostr.str();
- ostr.rdbuf()->freeze (0);
- return s;
+ ostringstream ostr;
+ ostr << i;
+ return ostr.str();
}
string
xdec (OSMisc::ulonglong i)
{
- ostrstream ostr;
-
-#if defined(_WINDOWS) && !defined(__MINGW32__) && !defined(__BORLANDC__)
- ostr << unsigned long(i) << ends; //XXX
+ ostringstream ostr;
+#if defined(_WINDOWS) && !defined(__MINGW32__)
+ ostr << unsigned long(i);
#else
- ostr << i << ends;
+ ostr << i;
#endif
-
- string s = ostr.str();
- ostr.rdbuf()->freeze (0);
- return s;
+ return ostr.str();
}
size_t