Skip to content
Update coding_standards authored by Luke Simonson's avatar Luke Simonson
......@@ -547,6 +547,11 @@ Better alternatives to `#defines` are discussed below
* `#define MIN_OF (a, b) (((a) < (b)) ? (a) : (b)) // THIS IS GOOD`
* `if` macro statements should always follow the pattern: `#if (...)`
* Example with multiple conditions: `#if ((...) && (...))`
* Avoid using `#ifdef MACRO` when `#if MACRO` can be used
* Example:
* `#define MACRO 0`
* `#if MACRO // this is clear`
* `#ifdef MACRO // this is not clear because it is not dependent on the actual value of MACRO`
* Macro invocations **do not** need to be surrounded in parentheses.
* Example:
* `#if FEATURE_UDS // This is perfectly fine`
......
......