Recursive C macro not expanded

前端 未结 3 883
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 12:38

I am working on a recursive macro. However, it seems that it is not expanded recursively. Here is a minimal working example to show what I mean:

// ignore input,         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 13:13

    You can't get the behaviour you want. The C preprocessor is, by design, not turing complete.

    You can use multiple macros to get multiple replacements, but you will not achieve true recursion with an arbitrary number of replacements.

提交回复
热议问题