Subject: [Boost-bugs] [Boost C++ Libraries] #5994: MSVC compiler misbehaviour - .lib & .exp files build for .EXE project
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-08 09:08:24
#5994: MSVC compiler misbehaviour - .lib & .exp files build for .EXE project
-----------------------------------------+----------------------------------
Reporter: piotr.ns2011@⦠| Owner: cnewbold
Type: Patches | Status: new
Milestone: To Be Determined | Component: pool
Version: Boost 1.47.0 | Severity: Cosmetic
Keywords: |
-----------------------------------------+----------------------------------
There is bug in VS 2010 (and older versions) which makes EXE projects to
build .LIB and .EXP files
when using DLL runtime and "new (std::nothrow)" - as in "boost\pool"
default_user_allocator_new_delete.
The patch below is a workaround for this problem.
According to this page: http://bit.ly/nCKoel
there are no plans to fix this error on MSVC side.
{{{
// -- file:
// boost\pool\pool.hpp
// -- under
// static char * malloc BOOST_PREVENT_MACRO_SUBSTITUTION(const size_type
bytes)
// -- replace
// { return new (std::nothrow) char[bytes]; }
// -- with:
#if defined(_DLL) && defined(_MSC_VER)
{ try { return new char[bytes]; } catch (...) { return NULL; } }
#else
{ return new (std::nothrow) char[bytes]; }
#endif
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5994> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC