0

The standard includes macros line _____LINE_____ & _____FILE_____, and C99 adds _____FUNCTION_____ which is technically not part of C++ yet.

What additional ones does MSVC++ add which are useful/cool? I found _____FUNCTION_____ is supported but are there any other totally MS-specific ones worth knowing about?

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
  • Related: https://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros – o11c Jun 06 '16 at 20:30

1 Answers1

1

MSDN has a list of all of the predefined macros used by Visual C++.

The most widely used is arguably _WIN32, which can be used for conditionally including Windows-specific headers and functionality in cross-platform software.

_MSC_VER defines the compiler version number and is useful if you need to rely on functionality introduced in a more recent version of the compiler or need to work around a bug that existed in an older version.

James McNellis
  • 348,265
  • 75
  • 913
  • 977