SPC  Version 0.9.5
 All Files Functions Groups Pages
#define

The #define command is used for macro substitution.

Redefinition of a macro will result in a compiler warning. Macros are normally restricted to one line because the newline character at the end of the line acts as a terminator. However, you can write multiline macros by instructing the preprocessor to ignore the newline character. This is accomplished by escaping the newline character with a backslash ('\'). The backslash character must be the very last character in the line or it will not extend the macro definition to the next line. The code sample below shows how to write a multi-line preprocessor macro.

#define foo(x) do { bar(x); \\
baz(x); } while(false)

The #undef directive may be used to remove a macro's definition.