views:

33

answers:

1

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?

+1  A: 

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