Ticket #8361: assert_msg.hpp.patch

File assert_msg.hpp.patch, 1.2 KB (added by Andrey Semashev, 10 years ago)

The patch automatically enables the linking problem workaround and uses static_assret when possible.

  • boost/spirit/home/support/assert_msg.hpp

     
    1010#pragma once
    1111#endif
    1212
    13 // Allow to work around the MPL problem in BOOST_MPL_ASSERT_MSG generating
    14 // multiple definition linker errors for certain compilers (VC++)
    15 #if BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG != 0
     13#include <boost/config.hpp>
     14
     15// Work around the MPL problem in BOOST_MPL_ASSERT_MSG generating
     16// multiple definition linker errors for certain compilers (VC++ 8).
     17// BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG can also be defined by user.
     18#if !defined(BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG)
     19#if defined(BOOST_MSVC) && BOOST_MSVC < 1500
     20#define BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG 1
     21#endif
     22#endif
     23
     24#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG != 0
    1625#include <boost/static_assert.hpp>
    1726#define BOOST_SPIRIT_ASSERT_MSG(Cond, Msg, Types)                             \
    18         BOOST_STATIC_ASSERT(Cond)
     27        BOOST_STATIC_ASSERT_MSG(Cond, Msg)
    1928#else
    2029#include <boost/mpl/assert.hpp>
    2130#define BOOST_SPIRIT_ASSERT_MSG(Cond, Msg, Types)                             \