Detecting option '-Gr' in MSVC
-
Does anybody know how to detect when option
-Gr
is in effect? I mean there is (AFAICS) no built-indefine _Gr
in such a case.-- Gisle V.
-
Does anybody know how to detect when option
-Gr
is in effect? I mean there is (AFAICS) no built-indefine _Gr
in such a case.-- Gisle V.
-
Hi, With the MSVC compiler you can do:
#ifdef _CPPRTTI
// Run-Time Type Information is enabled
#endifI think with GCC you can do:
#ifdef __GXX_RTTI
// Run-Time Type Information is enabled
#endifBest Wishes, -David Delaune
Thanks, but RTTI and option `-GR` has nothing to do with option `-Gr` AFAICS. `-Gr` is fastcall and `-GR` is to enable C++ RTTI.
-- Gisle V.
-
Thanks, but RTTI and option `-GR` has nothing to do with option `-Gr` AFAICS. `-Gr` is fastcall and `-GR` is to enable C++ RTTI.
-- Gisle V.
Yeah I missed the lower case. (I'm getting old and losing my eye sight.) On an older version of Visual Studio you would need to parse __FUNCSIG__ with some preprocessor wizardry. This macro is only available inside the function. Visual Studio 2012 and above supports the latest C++11,C++14 Decltype and Call Expressions[^] version 1.1 You would use it like this: Callable Objects with different calling conventions[^] Best Wishes, -David Delaune