2 ms·
When there’s not enough room for sprintf
- matthews2 4y ago#define setFault(faultBit) { shortStatus.faults |= faultbit; longStatus.faults |= faultBit; } I think it's best to declare the function 'static inline' and shove it into a header. With this macro faultBit (the argument) is evaluated twice, and it's not wrapped in a do-while so you could have problems if you don't use braces for your if statement bodies. You also need to deal with escaping newlines in macros.