Preprocessor conditional compilation directives allow compiling or skipping a part of the program depending on the fulfillment of a certain condition.
That condition can take one of the following forms.
Any of the conditional compilation directives can be followed by any number of lines possibly containing #else directive and ending with #endif. If the verified condition is true, the lines between #else and #endif are ignored. If the verified condition is not fulfilled, all lines between checking and #else directive (or #endif directive if the former is absent) are ignored.
Depending on the program type and compilation mode, the standard macros are defined the following way:
__MQL5__ macro is defined when compiling *.mq5 file, __MQL4__ macro is defined when compiling *.mq4 one.
_DEBUG macro is defined when compiling in debug mode.
_RELEASE macro is defined when compiling in release mode.