summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-11-03 12:27:44 (GMT)
committerBrad King <brad.king@kitware.com>2004-11-03 12:27:44 (GMT)
commite34207c1f0493c002da8c74897b81a72ef3ef2d4 (patch)
tree989438c9c4828832bb0b816d02e037bd18e04756
parentd46d8df0edfcfac46390319db8213601a5cd4260 (diff)
downloadCMake-e34207c1f0493c002da8c74897b81a72ef3ef2d4.zip
CMake-e34207c1f0493c002da8c74897b81a72ef3ef2d4.tar.gz
CMake-e34207c1f0493c002da8c74897b81a72ef3ef2d4.tar.bz2
COMP: Fix new cmGeneratedFileStream for MSVC.
-rw-r--r--Source/cmGeneratedFileStream.cxx4
-rw-r--r--Source/cmGeneratedFileStream.h2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx7
3 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 6fe889d..1e470c8 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -31,7 +31,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(const char* name,
bool copy_if_different,
bool quiet):
cmGeneratedFileStreamBase(name, copy_if_different),
- std::ofstream(m_TempName.c_str())
+ Stream(m_TempName.c_str())
{
// Check if the file opened.
if(!*this && !quiet)
@@ -49,7 +49,7 @@ cmGeneratedFileStream::~cmGeneratedFileStream()
// stream will be destroyed which will close the temporary file.
// Finally the base destructor will be called to replace the
// destination file.
- m_Okay = *this;
+ m_Okay = (*this)?true:false;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index b12461f..f447370 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -61,6 +61,8 @@ class cmGeneratedFileStream: private cmGeneratedFileStreamBase,
public std::ofstream
{
public:
+ typedef std::ofstream Stream;
+
/**
* The constructor takes the name of the file to be generated. It
* automatically generates a name for the temporary file. The
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index ecad472..0184833 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -289,15 +289,12 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile(cmLocalGenerator* root,
fname += "/";
fname += root->GetMakefile()->GetProjectName();
fname += ".sln";
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname.c_str(), true);
if(!fout)
{
- cmSystemTools::Error("Error can not open DSW file for write: ",
- fname.c_str());
- cmSystemTools::ReportLastSystemError("");
return;
}
- this->WriteSLNFile(fout.GetStream(), root, generators);
+ this->WriteSLNFile(fout, root, generators);
}
// output the SLN file