From c7006d2ef1c0e511ddccc7393cc2fd0d89a94b4c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 May 2016 14:44:13 -0400 Subject: [PATCH] cmGeneratorTarget: Protect macro code layout from clang-format The `IMPLEMENT_VISIT_IMPL` macro must preserve a space before the `>` character in case the `DATATYPE` is a template type ending in `>`. Manually format the macro layout as clang-format would except for this space. Then add markup to tell clang-format not to format this macro. --- Source/cmGeneratorTarget.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4ffe2f02b..dffe4cc5e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -559,18 +559,18 @@ static void handleSystemIncludesDep(cmLocalGenerator *lg, } } -#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \ - { \ - std::vector sourceFiles; \ - this->GetSourceFiles(sourceFiles, config); \ - TagVisitor< DATA##Tag DATATYPE > visitor(this, data); \ - for(std::vector::const_iterator si = sourceFiles.begin(); \ - si != sourceFiles.end(); ++si) \ - { \ - visitor.Accept(*si); \ - } \ - } \ - +/* clang-format off */ +#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \ + { \ + std::vector sourceFiles; \ + this->GetSourceFiles(sourceFiles, config); \ + TagVisitor< DATA##Tag DATATYPE > visitor(this, data); \ + for (std::vector::const_iterator si = sourceFiles.begin(); \ + si != sourceFiles.end(); ++si) { \ + visitor.Accept(*si); \ + } \ + } +/* clang-format on */ #define IMPLEMENT_VISIT(DATA) \ IMPLEMENT_VISIT_IMPL(DATA, EMPTY) \