A preprocessor &quot;trick&quot; not mentioned in the article is the use of GNU statement expressions.<p>The article describes the do {} while(0) trick to make macros look like statements. They can then basically be used like inline void function calls. But what if you want to write a macro to replace an inline function that returns a result?<p>Statement expressions [1] solve that problem. Now you can finally do this:<p><pre><code>    int _foo(int x) { return 2 * x; }

    #ifdef __DEBUG__
    #   define foo(x) \({                     \
            int r = _foo(x);                  \
            printf(                           \
                &quot;foo returned: %d (%s:%d)\n&quot;, \
                r, __FILE__, __LINE__         \
            );                                \
            r;                                \
        })
    #else
    #   define foo _foo
    #endif
</code></pre>
They are supported by most popular compilers which are not made by Microsoft (including GCC and clang).<p>[1] <a href="https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;gcc&#x2F;Statement-Exprs.html" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;gcc&#x2F;Statement-Exprs.html</a>