Skip to content

Commit f4c0717

Browse files
committed
[libunwind] Use consistent indentation in __libunwind_config.h
Use consistent indentation patterns all across `__libunwind_config.h`. The huge number of branches of the preprocessor conditions make them really unreadable when some of them are not indented. Signed-off-by: Michał Górny <[email protected]>
1 parent 7fb8630 commit f4c0717

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

libunwind/include/__libunwind_config.h

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#define _LIBUNWIND_VERSION 15000
1313

14+
// Disable clang-format as it makes the huge conditions unreadable.
15+
// clang-format off
1416
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
1517
!defined(__ARM_DWARF_EH__) && !defined(__SEH__)
1618
#define _LIBUNWIND_ARM_EHABI
@@ -136,17 +138,16 @@
136138
# error "Unsupported MIPS ABI and/or environment"
137139
# endif
138140
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
139-
#elif defined(__sparc__) && defined(__arch64__)
140-
#define _LIBUNWIND_TARGET_SPARC64 1
141-
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
142-
_LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64
143-
#define _LIBUNWIND_CONTEXT_SIZE 33
144-
#define _LIBUNWIND_CURSOR_SIZE 45
141+
# elif defined(__sparc__) && defined(__arch64__)
142+
# define _LIBUNWIND_TARGET_SPARC64 1
143+
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64
144+
# define _LIBUNWIND_CONTEXT_SIZE 33
145+
# define _LIBUNWIND_CURSOR_SIZE 45
145146
# elif defined(__sparc__)
146-
#define _LIBUNWIND_TARGET_SPARC 1
147-
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
148-
#define _LIBUNWIND_CONTEXT_SIZE 16
149-
#define _LIBUNWIND_CURSOR_SIZE 23
147+
# define _LIBUNWIND_TARGET_SPARC 1
148+
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
149+
# define _LIBUNWIND_CONTEXT_SIZE 16
150+
# define _LIBUNWIND_CURSOR_SIZE 23
150151
# elif defined(__riscv)
151152
# define _LIBUNWIND_TARGET_RISCV 1
152153
# if defined(__riscv_flen)
@@ -162,7 +163,7 @@
162163
# else
163164
# error "Unsupported RISC-V ABI"
164165
# endif
165-
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
166+
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
166167
# elif defined(__ve__)
167168
# define _LIBUNWIND_TARGET_VE 1
168169
# define _LIBUNWIND_CONTEXT_SIZE 67
@@ -173,20 +174,19 @@
173174
# define _LIBUNWIND_CONTEXT_SIZE 34
174175
# define _LIBUNWIND_CURSOR_SIZE 46
175176
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X
176-
#elif defined(__loongarch__)
177-
#define _LIBUNWIND_TARGET_LOONGARCH 1
178-
#if __loongarch_grlen == 64
179-
#define _LIBUNWIND_CONTEXT_SIZE 65
180-
#define _LIBUNWIND_CURSOR_SIZE 77
181-
#else
182-
#error "Unsupported LoongArch ABI"
183-
#endif
184-
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
185-
_LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH
186-
#elif defined(__wasm__)
177+
# elif defined(__loongarch__)
178+
# define _LIBUNWIND_TARGET_LOONGARCH 1
179+
# if __loongarch_grlen == 64
180+
# define _LIBUNWIND_CONTEXT_SIZE 65
181+
# define _LIBUNWIND_CURSOR_SIZE 77
182+
# else
183+
# error "Unsupported LoongArch ABI"
184+
# endif
185+
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH
186+
# elif defined(__wasm__)
187187
// Unused
188-
#define _LIBUNWIND_CONTEXT_SIZE 0
189-
#define _LIBUNWIND_CURSOR_SIZE 0
188+
# define _LIBUNWIND_CONTEXT_SIZE 0
189+
# define _LIBUNWIND_CURSOR_SIZE 0
190190
# else
191191
# error "Unsupported architecture."
192192
# endif
@@ -211,5 +211,6 @@
211211
# define _LIBUNWIND_CURSOR_SIZE 204
212212
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
213213
#endif // _LIBUNWIND_IS_NATIVE_ONLY
214+
// clang-format on
214215

215216
#endif // ____LIBUNWIND_CONFIG_H__

0 commit comments

Comments
 (0)