Open ghost opened 6 years ago
Hello from the future; I too do not know.
This is a workaround. Define a macro that can be used for each line of _Generic, the macro allows you to omit the colon. Then using the Mozilla style you get the following.
#define GEN_LINE(type, fn) \
type: \
fn
#define absValue(m) \
_Generic((m), \
GEN_LINE(F32, F32_absValue), \
GEN_LINE(F64, F64_absValue), \
GEN_LINE(F80, F80_absValue), \
GEN_LINE(int, Int_absValue), \
GEN_LINE(long, Long_absValue), \
GEN_LINE(long long, LongLong_absValue))(m)
While working on https://github.com/dotnet/corefx/pull/30495, I realized that clang-format has transformed:
into:
and couldn't quite figure out which *colon* rule needs to be set to leave alone _Generic block: https://clang.llvm.org/docs/ClangFormatStyleOptions.html.