C++ macro defined using do while causing error -
i have 2 pieces of code need make running. (no, not allowed change either of them).
first piece defines macro
#define macro { /* stuff in multiple lines , not return value */ } while (0)
second piece uses macro in if
statement
if (another_macro) { /* stuff */ }
i need make another_macro
use macro
, allowed define another_macro
.
i thought inline
function right way it, neither using macros nor using inline
functions work. suggestions?
just insert function call macro
on 1 side , return value on other.
#define another_macro thefunc() bool thefunc() { macro; return /* */; }
Comments
Post a Comment