From e373dbbe07c2a2e5e858ef8909d9e569b594894f Mon Sep 17 00:00:00 2001 From: hiker Date: Wed, 30 May 2007 07:26:50 +0000 Subject: [PATCH] Fix windows writing bug (see 1124 on trunk). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1138 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/lisp/writer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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];