Ticket #4360: enable_error_info_CodeGear2010.patch

File enable_error_info_CodeGear2010.patch, 1.8 KB (added by niels_dekker, 12 years ago)

Update: modifications of info.hpp and enable_error_info_test.cpp appear sufficient.

  • boost/exception/info.hpp

     
    1717#include <boost/exception/detail/error_info_impl.hpp>
    1818#include <boost/shared_ptr.hpp>
    1919#include <boost/config.hpp>
     20#include <boost/detail/workaround.hpp>
    2021#include <map>
    2122
    2223namespace
     
    192193        {
    193194        return exception_detail::set_info(x,v);
    194195        }
     196
     197#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x621) )
     198    // Workaround to avoid a Borland/CodeGear error, "Error E2316: 'data_' is not
     199    // a member of 'ostream' in function set_info<ostream,tag_test_int,int>(...)"
     200    template <class Tag,class T>
     201    inline
     202    char
     203    operator<<( ::std::ostream const & , ::boost::error_info<Tag,T> const & );
     204#endif
    195205    }
    196206
    197207#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
  • libs/exception/test/enable_error_info_test.cpp

     
    88#include <boost/exception/info.hpp>
    99#include <boost/exception/diagnostic_information.hpp>
    1010#include <boost/detail/lightweight_test.hpp>
     11#include <boost/detail/workaround.hpp>
    1112
    1213namespace
    1314    {
     15#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x621) )
     16    // Working around a compiler bug reported at Embarcadero C++Builder Report #85504,
     17    // "typeid (pointer to incomplete type) triggers link error: Unresolved external"
     18    // http://qc.embarcadero.com/wc/qcmain.aspx?d=85504
     19    struct tag_test_int {};
     20#endif
     21
    1422    typedef boost::error_info<struct tag_test_int,int> test_int;
    1523
    1624    void