You can print out the value of a preprocessor variable under visual studio. The following prints out the value of _MSC_VER:
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#pragma message(STRING(_MSC_VER))
Not sure how standard this is though.