mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 10:10:28 +00:00
Hack clang-format config to format our macros better. (#2514)
This somewhat abuses control-flow macro handling in `clang-format` to get the behavior we want. Fortunately, I don't think we're ever likely to want this for its intended purpose so it seems harmless to co-opt it like this. If we really wanted, we can narrow it to `if`-macros, but I picked the simpler option to start. FWIW, I tried all the other macro formatting special cases to see if one would work but it didn't. Might be worth filing a feature request to get a `TypeDefinitionMacros` setting to compliment `TypenameMacros` and format like this does, but it seems (very) low priority.
This commit is contained in:
1 parent
2f84751d2b
commit
d61531c82c
6 files changed
+8
-5
No files matched your search
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
CARBON_DEFINE_RAW_ENUM_CLASS(TestKind, uint8_t){
|
||||
CARBON_DEFINE_RAW_ENUM_CLASS(TestKind, uint8_t) {
|
||||
#define CARBON_ENUM_BASE_TEST_KIND(Name) CARBON_RAW_ENUM_ENUMERATOR(Name)
|
||||
#include "toolchain/common/enum_base_test.def"
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user