Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67880 - trunk/boost/chrono/detail
From: vicente.botet_at_[hidden]
Date: 2011-01-09 16:04:26


Author: viboes
Date: 2011-01-09 16:04:26 EST (Sun, 09 Jan 2011)
New Revision: 67880
URL: http://svn.boost.org/trac/boost/changeset/67880

Log:
Boost.Chrono: Add meta-info for debug
Boost.Chrono: Try to solve SUN issue: mismatch between void(*)(void*) and extern "C" void(void*)

 Test output: Sandia-sun - chrono - io_ex2_shared / sun-5.10
Rev 67818 / Sun, 9 Jan 2011 01:15:36 +0000
Report Time: Sun, 9 Jan 2011 19:06:16 +0000

Compile [2011-01-09 02:06:49 UTC]: fail

    "/opt/sunstudio12.1/bin/CC" +d -library=stlport4 -features=tmplife -features=tmplrefstatic -g -erroff=%none -m64 -KPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_CHRONO_USES_MPL_ASSERT -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_TYPEOF_EMULATION -DBOOST_USE_WINDOWS_H -I".." -c -o "/scratch2/kbelco/boost/results/boost/bin.v2/libs/chrono/test/io_ex2_shared.test/sun-5.10/debug/address-model-64/stdlib-sun-stlport/io_ex2.o" "../libs/chrono/test/../example/io_ex2.cpp"

"../boost/chrono/detail/scan_keyword.hpp", line 69: Error: Could not find a match for boost::interprocess::unique_ptr<unsigned char, void(*)(void*)>::unique_ptr(int, extern "C" void(void*))
needed in boost::chrono::chrono_detail::scan_keyword<std::istreambuf_iterator<char, std::char_traits<char>>, const std::string *>(std::istreambuf_iterator<char, std::char_traits<char>>&, std::istreambuf_iterator<char, std::char_traits<char>>, const std::string *, const std::string *, int&).
"../boost/chrono/chrono_io.hpp", line 271: Where: While instantiating "boost::chrono::chrono_detail::scan_keyword<std::istreambuf_iterator<char, std::char_traits<char>>, const std::string *>(std::istreambuf_iterator<char, std::char_traits<char>>&, std::istreambuf_iterator<char, std::char_traits<char>>, const std::string *, const std::string *, int&)".
"../boost/chrono/chrono_io.hpp", line 271: Where: Instantiated from boost::chrono::operator>><char, std::char_traits<char>, long long, boost::ratio<1, 1>>(std::istream &, boost::chrono::duration<long long, boost::ratio<1, 1>>&).
"../libs/chrono/test/../example/io_ex2.cpp", line 27: Where: Instantiated from non-template code.
1 Error(s) detected.

TinyUrl

Text files modified:
   trunk/boost/chrono/detail/scan_keyword.hpp | 11 +++++------
   1 files changed, 5 insertions(+), 6 deletions(-)

Modified: trunk/boost/chrono/detail/scan_keyword.hpp
==============================================================================
--- trunk/boost/chrono/detail/scan_keyword.hpp (original)
+++ trunk/boost/chrono/detail/scan_keyword.hpp 2011-01-09 16:04:26 EST (Sun, 09 Jan 2011)
@@ -22,7 +22,6 @@
 #include <boost/interprocess/smart_ptr/unique_ptr.hpp>
 #include <ios>
 #include <exception>
-//~ #include <cstdlib>
 #include <stdlib.h>
 
 namespace boost {
@@ -31,6 +30,8 @@
 namespace chrono {
 namespace chrono_detail {
 
+void free_aux(void* ptr) { free(ptr); }
+
 // scan_keyword
 // Scans [b, e) until a match is found in the basic_strings range
 // [kb, ke) or until it can be shown that there is no match in [kb, ke).
@@ -57,16 +58,15 @@
                )
 {
     typedef typename std::iterator_traits<InputIterator>::value_type CharT;
-#ifdef BOOST_CORONO_IO_USES_LEX
-
-#else
     size_t nkw = std::distance(kb, ke);
     const unsigned char doesnt_match = '\0';
     const unsigned char might_match = '\1';
     const unsigned char does_match = '\2';
     unsigned char statbuf[100];
     unsigned char* status = statbuf;
- unique_ptr<unsigned char, void(*)(void*)> stat_hold(0, free);
+ // Change free by free_aux to avoid
+ // Error: Could not find a match for boost::interprocess::unique_ptr<unsigned char, void(*)(void*)>::unique_ptr(int, extern "C" void(void*))
+ unique_ptr<unsigned char, void(*)(void*)> stat_hold(0, free_aux);
     if (nkw > sizeof(statbuf))
     {
         status = (unsigned char*)malloc(nkw);
@@ -155,7 +155,6 @@
     if (kb == ke)
         err |= std::ios_base::failbit;
     return kb;
-#endif
 }
 }
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk