diff --git a/src/lisp/writer.cpp b/src/lisp/writer.cpp index 4670f4d31..656ccf267 100644 --- a/src/lisp/writer.cpp +++ b/src/lisp/writer.cpp @@ -35,7 +35,15 @@ namespace lisp : m_indent_depth(0) { m_owner = true; +#ifdef WIN32 + // With mingw, the files are written dos style (crlf), but + // these files can't be read with the lexer here. So we have + // to force the file to be written as binary for windows. + printf("Setting binary"); + m_out = new std::ofstream(filename.c_str(),::std::ios_base::binary); +#else m_out = new std::ofstream(filename.c_str()); +#endif if(!m_out->good()) { char msg[MAX_ERROR_MESSAGE_LENGTH];