Conditionally includes source code according to compile-time symbols.
#if Expression ... #elif Expression ... #else ... #endif #define Symbol
KEYSHARP is always defined.WINDOWS, LINUX or OSX is defined for the target platform.Symbols and expressions are case-insensitive. #define adds a symbol for the remainder of preprocessing.
Use && (and), || (or), ! (not), parentheses, symbol names, 1 (true) or 0 (false). Every conditional block must end with #endif.
#if WINDOWS
MsgBox "Windows"
#elif LINUX
MsgBox "Linux"
#elif OSX
MsgBox "macOS"
#endif
#if !(WINDOWS || LINUX)
MsgBox "Not Windows or Linux"
#endif
#define FEATURE_X
#if FEATURE_X
MsgBox "Feature X enabled"
#endif