2

There's already (more than one) QA on how to "detect if I'm compiling with Visual Studio XXXX". However the proposed use of the _MSC_VER_ macro does not fit my needs since I'm using the Clang compiler i.e. the clang front end (instead of C1) with the Visual Studio code generator (backend - C2).

Again, I'm in VS but use another compiler. In this scenario, how would I go about conditionally compiling my code? Is there an alternative _CHECK_C1 macro that would allow me to do:

#if _CHECK_C1
// code for visual studio compiler
#else
// code for clang and gcc
#endif
Community
  • 1
  • 1
Lorah Attkins
  • 5,331
  • 3
  • 29
  • 63
  • 1
    https://blogs.msdn.microsoft.com/vcblog/2015/12/04/clang-with-microsoft-codegen-in-vs-2015-update-1/ – Justin Feb 16 '17 at 21:58
  • Anyone care to explain the downvotes? – Lorah Attkins Feb 16 '17 at 22:08
  • 1
    I agree, the downvotes are not deserved. This kind of thing might happen when a question is easy to misunderstand after just cursory look, it is downvoted once, then other voters become predjudiced by the negative score and follow suit. – Christopher Oicles Feb 16 '17 at 23:46

0 Answers0