Boost logo

Boost :

From: Davlet Panech (dp1978x_lists_at_[hidden])
Date: 2004-12-13 16:14:13


Added missing int64_t to wide string conversion for MSVC6.


--- boost/date_time/posix_time/time_formatters.hpp.orig 2004-12-13 14:52:15.054188600 -0500
+++ boost/date_time/posix_time/time_formatters.hpp 2004-12-12 17:42:54.000000000 -0500
@@ -6,7 +6,7 @@
  * Boost Software License, Version 1.0. (See accompanying
  * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
  * Author: Jeff Garland, Bart Garst
- * $Date: 2004/11/04 12:28:49 $
+ * $Date: 2004/10/29 06:27:24 $
  */
 
 #include "boost/date_time/gregorian/gregorian.hpp"
@@ -26,6 +26,20 @@
 namespace boost {
 
 namespace posix_time {
+
+#if (defined(BOOST_MSVC) && (_MSC_VER <= 1200)) // 1200 == VC++ 6.0
+ namespace detail {
+ template <typename charT> struct convert_int64;
+ template <> struct convert_int64<char> {
+ static char *convert (char *buff, boost::int64_t i)
+ { return _i64toa(i, buff, 10); }
+ };
+ template <> struct convert_int64<wchar_t> {
+ static wchar_t *convert (wchar_t *buff, boost::int64_t i)
+ { return _i64tow(i, buff, 10); }
+ };
+ }
+#endif
 
   // template function called by wrapper functions:
   // to_*_string(time_duration) & to_*_wstring(time_duration)
@@ -69,7 +83,7 @@
         date_time::absolute_value(td.fractional_seconds());
       // JDG [7/6/02 VC++ compatibility]
       charT buff[32];
- _i64toa(frac_sec, buff, 10);
+ detail::convert_int64<charT>::convert(buff, frac_sec);
 #else
       time_duration::fractional_seconds_type frac_sec =
         date_time::absolute_value(td.fractional_seconds());
@@ -138,7 +152,7 @@
         date_time::absolute_value(td.fractional_seconds());
       // JDG [7/6/02 VC++ compatibility]
       charT buff[32];
- _i64toa(frac_sec, buff, 10);
+ detail::convert_int64<charT>::convert(buff, frac_sec);
 #else
       time_duration::fractional_seconds_type frac_sec =
         date_time::absolute_value(td.fractional_seconds());


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk