What you have mentioned is called a #define, a compile time constant. These defines need to be.... defined (duh!!), if they are not defined then they are null therefore the expression fails. Your original linked example was for C++, so naturally it isn't defined for you in C#.
Under the hood Visual Studio uses MSBuild to do the actual compilation of your projects (MSBuild then invokes the compiler). The Visual Studio version you are using isn't available to MSBuild. Even trying to use a pre-build macro will not work because that is executed in the context of MSBuild/TFSBuild, at that point in time Visual Studio isn't within the context.
I should also point out that you have confused the Visual Studio version with the compiler version - and the compiler version also isn't natively available as a define.
Your best option is to create and use a custom MSBuild/TFSBuild build definition, you can then set these #defines as parameters to the build and you can also control which compiler is invoked (although that is too complex to show as an answer here). You would have one build definition for targeting the C# 6 compiler, and one for the default compiler.