Indenting #defines

后端 未结 9 2085
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 00:34

I know that #defines, etc. are normally never indented. Why?

I\'m working in some code at the moment which has a horrible mixture of #define

9条回答
  •  天命终不由人
    2020-11-30 01:01

    I know this is old topic but I wasted couple of days searching for solution. I agree with initial post that intending makes code cleaner if you have lots of them (in my case I use directives to enable/disable verbose logging). Finally, I found solution here which works Visual Studio 2017

    If you like to indent #pragma expressions, you can enable it under: Tools > Options > Text Editor > C/C++ > Formatting > Indentation > Position of preprocessor directives > Leave indented

    The only problem left is that auto code layout fixed that formatting =(

提交回复
热议问题