1using System; 2 3namespace CSharp 4{ 5 public class CSharpApp 6 { 7 const string InfoCompiler = "INFO:compiler[Microsoft " 8#if PlatformToolsetv100 9 + "Visual Studio" 10#elif PlatformToolsetv110 11 + "Visual Studio" 12#elif PlatformToolsetv120 13 + "Visual Studio" 14#elif PlatformToolsetv140 15 + "Visual Studio" 16#elif PlatformToolsetv141 17 + "Visual Studio" 18#elif PlatformToolsetv142 19 + "Visual Studio" 20#elif PlatformToolsetv143 21 + "Visual Studio" 22#else 23 + "unknown" 24#endif 25 + "]"; 26 27 const string InfoPlatform = "INFO:platform[Windows]"; 28 29 const string InfoArchitecture = "INFO:arch[" 30#if Platformx64 31 + "x64" 32#elif Platformx86 33 + "x86" 34#elif PlatformxWin32 35 + "Win32]" 36#else 37 + "unknown" 38#endif 39 + "]"; 40 41 const string InfoCompilerVersion = "INFO:compiler_version[" 42#if PlatformToolsetv100 43 + "2010" 44#elif PlatformToolsetv110 45 + "2012" 46#elif PlatformToolsetv120 47 + "2013" 48#elif PlatformToolsetv140 49 + "2015" 50#elif PlatformToolsetv141 51 + "2017" 52#elif PlatformToolsetv142 53 + "2019" 54#elif PlatformToolsetv143 55 + "2022" 56#else 57 + "9999" 58#endif 59 + "]"; 60 61 static void Main(string[] args) 62 { 63 // we have to print the lines to make sure 64 // the compiler does not optimize them away ... 65 System.Console.WriteLine(InfoCompiler); 66 System.Console.WriteLine(InfoPlatform); 67 System.Console.WriteLine(InfoArchitecture); 68 System.Console.WriteLine(InfoCompilerVersion); 69 } 70 } 71} 72