[go: up one dir, main page]

Skip to content

Indents in pre-processor definitions

Consider a macro definition like this:

#define MACRO_INIT(a, b, c, d, e) \
{ \
    .a = a, \
    .b = b, \
    .c = c, \
    .d = d, \
    .e = e \
}

Which is used to initialise a structure using designated initializers.

When run through AStyle, with the --indent-preproc-define option enabled, the output is messed up:

#define MACRO_INIT(a, b, c, d, e) \
    { \
        .a = a, \
             .b = b, \
                  .c = c, \
                       .d = d, \
                            .e = e \
    }

Is it possible to make AStyle avoid further indenting each time?