For VC++ and clang-cl if _HAS_EXCEPTIONS is 0, then the <exception> header must be manually included before the <typeinfo> header to avoid compiler errors.

This commit is contained in:
Edward Diener
2013-12-11 18:53:21 -05:00
parent deedcb848f
commit ceafb39c24

View File

@ -86,9 +86,18 @@
# define BOOST_NO_STD_LOCALE # define BOOST_NO_STD_LOCALE
#endif #endif
// Fix for VC++ 8.0 on up ( I do not have a previous vesion 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)))
#include <exception>
#endif
#include <typeinfo> #include <typeinfo>
#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) && !defined(__TI_COMPILER_VERSION__) #if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) && !defined(__TI_COMPILER_VERSION__)
# define BOOST_NO_STD_TYPEINFO # define BOOST_NO_STD_TYPEINFO
#endif #endif
// C++0x headers implemented in 520 (as shipped by Microsoft) // C++0x headers implemented in 520 (as shipped by Microsoft)
@ -146,12 +155,3 @@
#else #else
# define BOOST_STDLIB "Dinkumware standard library version 1.x" # define BOOST_STDLIB "Dinkumware standard library version 1.x"
#endif #endif