ThrowTheSwitch / CMock

CMock - Mock/stub generator for C
http://throwtheswitch.org
MIT License
652 stars 269 forks source link

fix: Don't smush macros which have an escaped empty line at the end #437

Closed alufers closed 1 year ago

alufers commented 1 year ago

nanopb has a habit of generating macros which end with an escaped empty line (for example for messages which are empty). They look like this:

#define some_msg_t_FIELDLIST(X, a) \

#define some_msg_t_CALLBACK NULL

This caused CMock to strip all of the newlines after the backslash instead of only one, which the backslash was escaping. This in turn caused both the macros to be in one line, causing a compile error in the generated mock.

atypic commented 1 year ago

Thanks, this has been annoying.