| 1 | /** |
| 2 | * A simple define without a value |
| 3 | */ |
| 4 | #define USE_STUFF |
| 5 | |
| 6 | |
| 7 | /** |
| 8 | * A define with a simple value |
| 9 | */ |
| 10 | #define MAX_LENGTH 100 |
| 11 | |
| 12 | |
| 13 | /** |
| 14 | * A define with some parameters |
| 15 | * |
| 16 | * \param A The parameter A |
| 17 | * \param B The parameter B |
| 18 | * |
| 19 | * \returns The maximum of A and B |
| 20 | */ |
| 21 | #define MAXIMUM(A,B) ((A > B)?(A):(B)) |
| 22 | |
| 23 | |
| 24 | /** |
| 25 | * A define which spans multiple lines |
| 26 | */ |
| 27 | #define SWAP(A,B) { \ |
| 28 | (a) ^= (b); \ |
| 29 | (b) ^= (a); \ |
| 30 | (a) ^= (b); \ |
| 31 | } |