Further restrict typeinfo workarounds to msvc.

This commit is contained in:
jzmaddock
2020-07-25 19:46:13 +01:00
parent ab7bb5c511
commit 46e0a13496
2 changed files with 11 additions and 6 deletions

View File

@ -529,10 +529,13 @@ namespace boost {
# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
// When BOOST_NO_STD_TYPEINFO is defined, we can just import
// the global definition into std namespace:
#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus)
// the global definition into std namespace,
// see https://svn.boost.org/trac10/ticket/4115
#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus) && defined(BOOST_MSVC)
#include <typeinfo>
namespace std{ using ::type_info; }
// Since we do now have typeinfo, undef the macro:
#undef BOOST_NO_STD_TYPEINFO
#endif
// ---------------------------------------------------------------------------//

View File

@ -86,22 +86,24 @@
# define BOOST_NO_STD_LOCALE
#endif
#if BOOST_MSVC < 1800
#if ((defined(BOOST_MSVC) && BOOST_MSVC >= 1400) || (defined(__clang__) && defined(_MSC_VER))) && (_MSC_VER < 1800)
// Fix for VC++ 8.0 on up ( I do not have a previous version to test )
// or clang-cl. If exceptions are off you must manually include the
// <exception> header before including the <typeinfo> header. Admittedly
// trying to use Boost libraries or the standard C++ libraries without
// exception support is not suggested but currently clang-cl ( v 3.4 )
// does not support exceptions and must be compiled with exceptions off.
#if !_HAS_EXCEPTIONS && ((defined(BOOST_MSVC) && BOOST_MSVC >= 1400) || (defined(__clang__) && defined(_MSC_VER)))
#if !_HAS_EXCEPTIONS
#include <exception>
#endif
#include <typeinfo>
#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (defined(__ghs__) && !_HAS_NAMESPACE) ) && !defined(__TI_COMPILER_VERSION__) && !defined(__VISUALDSPVERSION__) \
&& !defined(__VXWORKS__) && !defined(BOOST_EMBTC_WINDOWS)
#if !_HAS_EXCEPTIONS
# define BOOST_NO_STD_TYPEINFO
#endif
#endif
#if defined(__ghs__) && !_HAS_NAMESPACE
# define BOOST_NO_STD_TYPEINFO
#endif
// C++0x headers implemented in 520 (as shipped by Microsoft)
//