Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Detecting option '-Gr' in MSVC

Detecting option '-Gr' in MSVC

Scheduled Pinned Locked Moved Managed C++/CLI
tutorialquestion
4 Posts 2 Posters 12 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gisle Vanem
    wrote on last edited by
    #1

    Does anybody know how to detect when option -Gr is in effect? I mean there is (AFAICS) no built-in define _Gr in such a case.

    -- Gisle V.

    L 1 Reply Last reply
    0
    • G Gisle Vanem

      Does anybody know how to detect when option -Gr is in effect? I mean there is (AFAICS) no built-in define _Gr in such a case.

      -- Gisle V.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, With the MSVC compiler you can do:

      #ifdef _CPPRTTI
      // Run-Time Type Information is enabled
      #endif

      I think with GCC you can do:

      #ifdef __GXX_RTTI
      // Run-Time Type Information is enabled
      #endif

      Best Wishes, -David Delaune

      G 1 Reply Last reply
      0
      • L Lost User

        Hi, With the MSVC compiler you can do:

        #ifdef _CPPRTTI
        // Run-Time Type Information is enabled
        #endif

        I think with GCC you can do:

        #ifdef __GXX_RTTI
        // Run-Time Type Information is enabled
        #endif

        Best Wishes, -David Delaune

        G Offline
        G Offline
        Gisle Vanem
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • G Gisle Vanem

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups