mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 06:15:23 +02:00
Merge pull request #36 from robinlinden/msvc-linking-fix
Fix BOOST_MPL_ASSERT_MSG for VC++8
This commit is contained in:
@@ -443,8 +443,16 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
|
|||||||
/**/
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
|
// Work around BOOST_MPL_ASSERT_MSG_IMPL generating multiple definition linker errors on VC++8.
|
||||||
|
#if defined(BOOST_MSVC) && BOOST_MSVC < 1500
|
||||||
|
# include <boost/static_assert.hpp>
|
||||||
|
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
|
||||||
|
BOOST_STATIC_ASSERT_MSG( c, #msg ) \
|
||||||
|
/**/
|
||||||
|
#else
|
||||||
|
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
|
||||||
BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \
|
BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \
|
||||||
/**/
|
/**/
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // BOOST_MPL_ASSERT_HPP_INCLUDED
|
#endif // BOOST_MPL_ASSERT_HPP_INCLUDED
|
||||||
|
@@ -13,6 +13,7 @@ compile apply_wrap.cpp ;
|
|||||||
compile arithmetic.cpp ;
|
compile arithmetic.cpp ;
|
||||||
compile as_sequence.cpp ;
|
compile as_sequence.cpp ;
|
||||||
compile assert.cpp ;
|
compile assert.cpp ;
|
||||||
|
link assert_vc8_p1.cpp assert_vc8_p2.cpp ;
|
||||||
compile at.cpp ;
|
compile at.cpp ;
|
||||||
compile back.cpp ;
|
compile back.cpp ;
|
||||||
compile bind.cpp ;
|
compile bind.cpp ;
|
||||||
|
28
test/assert_vc8.hpp
Normal file
28
test/assert_vc8.hpp
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
// Copyright Robin Linden 2018
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/mpl for documentation.
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
// $Date$
|
||||||
|
// $Revision$
|
||||||
|
|
||||||
|
// Part of a test to demonstrate a linking error with
|
||||||
|
// BOOST_MPL_ASSERT_MSG inside of functions under VC++8.
|
||||||
|
|
||||||
|
#include <boost/mpl/assert.hpp>
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
bool func()
|
||||||
|
{
|
||||||
|
BOOST_MPL_ASSERT_MSG(
|
||||||
|
true,
|
||||||
|
ALWAYS_TRUE,
|
||||||
|
(T));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
23
test/assert_vc8_p1.cpp
Normal file
23
test/assert_vc8_p1.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
// Copyright Robin Linden 2018
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/mpl for documentation.
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
// $Date$
|
||||||
|
// $Revision$
|
||||||
|
|
||||||
|
// Part of a test to demonstrate a linking error with
|
||||||
|
// BOOST_MPL_ASSERT_MSG inside of functions under VC++8.
|
||||||
|
|
||||||
|
#include "assert_vc8.hpp"
|
||||||
|
|
||||||
|
static bool a = func<int>();
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
}
|
19
test/assert_vc8_p2.cpp
Normal file
19
test/assert_vc8_p2.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
// Copyright Robin Linden 2018
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/mpl for documentation.
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
// $Date$
|
||||||
|
// $Revision$
|
||||||
|
|
||||||
|
// Part of a test to demonstrate a linking error with
|
||||||
|
// BOOST_MPL_ASSERT_MSG inside of functions under VC++8.
|
||||||
|
|
||||||
|
#include "assert_vc8.hpp"
|
||||||
|
|
||||||
|
static bool a = func<int>();
|
Reference in New Issue
Block a user