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

View File

@ -6,7 +6,7 @@ Boost.TypeIndex is a part of the [Boost C++ Libraries](http://github.com/boostor
@ | Build | Tests coverage | More info
----------------|-------------- | -------------- |-----------
Develop branch: | [![Build Status](https://travis-ci.org/apolukhin/type_index.svg?branch=develop)](https://travis-ci.org/apolukhin/type_index) [![Build status](https://ci.appveyor.com/api/projects/status/197a5imq10dqx6r8/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/type-index/branch/develop) | [![Coverage Status](https://coveralls.io/repos/apolukhin/type_index/badge.png?branch=develop)](https://coveralls.io/r/apolukhin/type_index?branch=develop) | [details...](http://www.boost.org/development/tests/develop/developer/type_index.html)
Master branch: | [![Build Status](https://travis-ci.org/apolukhin/type_index.svg?branch=master)](https://travis-ci.org/apolukhin/type_index) [![Build status](https://ci.appveyor.com/api/projects/status/197a5imq10dqx6r8/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/type-index/branch/master) | [![Coverage Status](https://coveralls.io/repos/apolukhin/type_index/badge.png?branch=master)](https://coveralls.io/r/apolukhin/type_index?branch=master) | [details...](http://www.boost.org/development/tests/master/developer/type_index.html)
Master branch: | [![Build Status](https://travis-ci.org/apolukhin/type_index.svg?branch=master)](https://travis-ci.org/apolukhin/type_index) [![Build status](https://ci.appveyor.com/api/projects/status/197a5imq10dqx6r8/branch/master?svg=true)](https://ci.appveyor.com/project/apolukhin/type-index/branch/master) | [![Coverage Status](https://coveralls.io/repos/apolukhin/type_index/badge.png?branch=master)](https://coveralls.io/r/apolukhin/type_index?branch=master) | [details...](http://www.boost.org/development/tests/master/developer/type_index.html)
[Open Issues](https://svn.boost.org/trac/boost/query?status=!closed&component=type_index)

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

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