Created attachment 11178 [details] Sample file > cat sha1.cpp #define sha1macro(func,val) \ { \ const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; \ e = d; \ } > clang-format sha1.cpp Can't find usable .clang-format, using LLVM style #define sha1macro(func, val) { const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; e = d; } sha1.cpp attached.
That works fine here, results in: #define sha1macro(func, val) \ { \ const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; \ e = d; \ } Can you provide more details? Which version of clang-format are you running, which platform are you running on, etc.? One thought, does that file contain windows line endings (<CR><NL>)?
(In reply to comment #1) > That works fine here, results in: > > #define sha1macro(func, val) \ > { \ > const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; \ > e = d; \ > } > > Can you provide more details? Which version of clang-format are you running, > which platform are you running on, etc.? Linux, clang r190394 > One thought, does that file contain windows line endings (<CR><NL>)? Yes it does and if I convert those newlines into Unix one clang-format works fine.
Most of the issues related to CR LF line endings are fixed in r190519. Starting from this revision, clang-format should correctly handle both LF and CR LF line endings, and output replacements with the line ending style prevalent in the input file.
*** Bug 17269 has been marked as a duplicate of this bug. ***