cgmb / guardonce

Utilities for converting from C/C++ include guards to #pragma once and back again.
MIT License
142 stars 3 forks source link

Handle Windows line endings on Linux and vice versa #13

Closed cgmb closed 5 years ago

cgmb commented 7 years ago

checkguard is rather unhappy when you use Windows line endings on Linux. It regards your files as being broken. Perhaps it should be more permissive. The point of checkguard is to let you know if there are potential problems with your include guards, not to admonish you for using the wrong line ending convention.

This definitely affects v2. Not sure about v1.

cgmb commented 6 years ago

I should also check it's not changing Unix newlines to Windows newlines on Windows. Line endings should remain consistent and independent of platform.

cgmb commented 6 years ago

It is indeed changing Unix newlines to Windows newlines. This is what's causing the test failures on Windows after aa890016b0b2a1901e90920d77176b31e9dde8ee. guardonce always writes Windows line endings on Windows, even if the input file had Unix line endings.