Accept '\r' as end-of-line character
Move definition of flags for windows.h