Workaround for /GR- override in tests

This commit is contained in:
Antony Polukhin
2018-01-16 00:28:48 +03:00
parent 70e51a62e9
commit cd659212aa
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
//
// Copyright (c) Antony Polukhin, 2012-2015.
// Copyright (c) Antony Polukhin, 2012-2018.
//
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -31,7 +31,7 @@ TEST_LIB_DECL boost::typeindex::type_index get_user_defined_class();
TEST_LIB_DECL boost::typeindex::type_index get_const_integer();
TEST_LIB_DECL boost::typeindex::type_index get_const_user_defined_class();
#ifndef BOOST_HAS_PRAGMA_DETECT_MISMATCH
#if !defined(BOOST_HAS_PRAGMA_DETECT_MISMATCH) || !defined(_CPPRTTI)
// This is required for checking RTTI on/off linkage
TEST_LIB_DECL void accept_typeindex(const boost::typeindex::type_index&);
#endif
+3 -1
View File
@@ -1,5 +1,5 @@
//
// Copyright Antony Polukhin, 2012-2015.
// Copyright Antony Polukhin, 2012-2018.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -41,6 +41,8 @@ void comparing_types_between_modules()
BOOST_TEST_NE(t_int, test_lib::get_user_defined_class());
BOOST_TEST_NE(t_const_int, test_lib::get_const_user_defined_class());
// MSVC supports detect_missmatch pragma, but /GR- silently switch disable the link time check.
// /GR- undefies the _CPPRTTI macro. Using it to detect working detect_missmatch pragma.
#if !defined(BOOST_HAS_PRAGMA_DETECT_MISMATCH) || !defined(_CPPRTTI)
test_lib::accept_typeindex(t_int);
#endif