summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2007-05-22 21:06:50 +0000
committerMark Spruiell <mes@zeroc.com>2007-05-22 21:06:50 +0000
commit59513b1790e86840f13755751e327df80e4bec33 (patch)
treec815edac4eacd13c8e02107b4fc97271a7919ab3 /cpp/src
parentBug 1022. (diff)
downloadice-59513b1790e86840f13755751e327df80e4bec33.tar.bz2
ice-59513b1790e86840f13755751e327df80e4bec33.tar.xz
ice-59513b1790e86840f13755751e327df80e4bec33.zip
bug 1854 - adding int64ToString
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/IceUtil/OutputUtil.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/OutputUtil.cpp b/cpp/src/IceUtil/OutputUtil.cpp
index e3ef63d1a45..953606520af 100644
--- a/cpp/src/IceUtil/OutputUtil.cpp
+++ b/cpp/src/IceUtil/OutputUtil.cpp
@@ -27,6 +27,20 @@ EndEscapes endEscapes;
}
+string
+IceUtil::int64ToString(Int64 val)
+{
+ char buf[64];
+#ifdef WIN32
+ sprintf(buf, "%I64d", val);
+#elif defined(ICE_64)
+ sprintf(buf, "%ld", val); // Avoids a format warning from GCC.
+#else
+ sprintf(buf, "%lld", val);
+#endif
+ return string(buf);
+}
+
// ----------------------------------------------------------------------
// OutputBase
// ----------------------------------------------------------------------