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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -