跳转至

AlignConsecutiveMacros

AlignConsecutiveMacros (AlignConsecutiveStyle)

Info

clang-format 9

对齐连续宏定义的样式。

Consecutive 会产生如下格式:

#define SHORT_NAME       42
#define LONGER_NAME      0x007f
#define EVEN_LONGER_NAME (2)
#define foo(x)           (x * x)
#define bar(y, z)        (y + z)

可能的值:

ACS_None: 不要在连续的行上对齐宏定义。

ACS_Consecutive: 在连续的行上对齐宏定义。这将导致如下格式:

#define SHORT_NAME       42
#define LONGER_NAME      0x007f
#define EVEN_LONGER_NAME (2)

#define foo(x) (x * x)
/* some comment */
#define bar(y, z) (y + z)

ACS_AcrossEmptyLines: 与 ACS_Consecutive 相同,但也跨空行,例如:

#define SHORT_NAME       42
#define LONGER_NAME      0x007f
#define EVEN_LONGER_NAME (2)

#define foo(x)           (x * x)
/* some comment */
#define bar(y, z) (y + z)

ACS_AcrossComments: 与 ACS_Consecutive 相同,但也可以跨越仅包含注释的行,例如:

#define SHORT_NAME       42
#define LONGER_NAME      0x007f
#define EVEN_LONGER_NAME (2)

#define foo(x)    (x * x)
/* some comment */
#define bar(y, z) (y + z)

ACS_AcrossEmptyLinesAndComments: 与 ACS_Consecutive 相同,但也可以跨行,只包含注释和空行,例如:

#define SHORT_NAME       42
#define LONGER_NAME      0x007f
#define EVEN_LONGER_NAME (2)

#define foo(x)           (x * x)
/* some comment */
#define bar(y, z)        (y + z)

最后更新: 2022-10-31