C and C++ compilers automatically define certain macros that can be used to check for compiler or operating system features. This is important when writing portable software.
The GNU C compiler apparently still permits this, and the VC++ 2005 compiler permits it too, though it issues a Level-4 warning if it’s C code, and a Level-2 warning if it’s C++ code.