How to use #if to decide which platform is being compiled for in C#
问题 In C++ there are predefined macros: #if defined(_M_X64) || defined(__amd64__) // Building for 64bit target const unsigned long MaxGulpSize = 1048576 * 128;// megabyte = 1048576; const unsigned long MaxRecsCopy = 1048576 * 16; #else const unsigned long MaxGulpSize = 1048576 * 8;// megabyte = 1048576; const unsigned long MaxRecsCopy = 1048576; #endif Which allows me to set constants to control the amount of memory that will be used. Of course I can define a preprocessor variable verbatim: