I am encountering an issue with clang-format
. Consider the following example header file:
#ifdef __cplusplus
extern "C" {
#endif
void foo(int x);
void foo2(int y);
#define FOO 2
#define BAR 3
void bar(int z);
#ifdef __cplusplus
}
#endif
I would like to indent the defines (FOO
and BAR
) to the same level as the declarations. Is there a way to do this with clang-format
?
Desired Result:
#ifdef __cplusplus
extern "C" {
#endif
void foo(int x);
void foo2(int y);
#define FOO 2
#define BAR 3
void bar(int z);
#ifdef __cplusplus
}
#endif