[config] RTTI detection on Intel C++
I was going to prepare a simple pull request that basically added #if !defined(__RTTI) && !defined(__INTEL_RTTI__) && !defined(__GXX_RTTI) && !defined(_CPPRTTI) #define BOOST_NO_RTTI #define BOOST_NO_TYPEID #endif to intel.hpp, but then I saw that this file doesn't contain any logic for BOOST_NO_EXCEPTIONS, relying instead on common_edg.hpp to check __EXCEPTIONS. So I wonder whether the preferred approach wouldn't be to check __RTTI in common_edg.hpp instead. Opinions? There's also a slight complication here because I suspect that when Intel is in Microsoft mode, when RTTI is off it will still support typeid, as MSVC does; so just BOOST_NO_RTTI would need to be defined, and not BOOST_NO_TYPEID.
I was going to prepare a simple pull request that basically added
#if !defined(__RTTI) && !defined(__INTEL_RTTI__) && !defined(__GXX_RTTI) && !defined(_CPPRTTI)
#define BOOST_NO_RTTI #define BOOST_NO_TYPEID
#endif
to intel.hpp, but then I saw that this file doesn't contain any logic for BOOST_NO_EXCEPTIONS, relying instead on common_edg.hpp to check __EXCEPTIONS.
So I wonder whether the preferred approach wouldn't be to check __RTTI in common_edg.hpp instead.
Opinions?
There's also a slight complication here because I suspect that when Intel is in Microsoft mode, when RTTI is off it will still support typeid, as MSVC does; so just BOOST_NO_RTTI would need to be defined, and not BOOST_NO_TYPEID.
I would say put what EDG usually does in common_edg.hpp and then override in the individual compiler header if it differs. Not sure how much that helps in this case.... maybe the "safe" thing to do is to disable both in common_edg.hpp when __RTTI is not set, then undef BOOST_NO_TYPEID when required (msvc)? John.
John Maddock wrote:
I would say put what EDG usually does in common_edg.hpp and then override in the individual compiler header if it differs.
It's a bit tricky because the macro name and whether it's defined by the EDG frontend can be configured. So when we see that __RTTI is not defined, we can't be sure that RTTI is off. Something else might be defined instead, depending on the compiler. So I went with just adding the checks to intel.hpp: https://github.com/boostorg/config/pull/26
participants (2)
-
John Maddock
-
Peter Dimov