COMP: Fix for auto_ptr usage on VC6's broken implementation.

This commit is contained in:
Brad King 2006-03-16 15:50:21 -05:00
parent 77c65b954e
commit 520b792f6f
1 changed files with 4 additions and 2 deletions

View File

@ -60,14 +60,16 @@ void cmExportLibraryDependenciesCommand::FinalPass()
std::auto_ptr<std::ofstream> foutPtr; std::auto_ptr<std::ofstream> foutPtr;
if(append) if(append)
{ {
foutPtr.reset(new std::ofstream(fname.c_str(), std::ios::app)); std::auto_ptr<std::ofstream> ap(
new std::ofstream(fname.c_str(), std::ios::app));
foutPtr = ap;
} }
else else
{ {
std::auto_ptr<cmGeneratedFileStream> ap( std::auto_ptr<cmGeneratedFileStream> ap(
new cmGeneratedFileStream(fname.c_str(), true)); new cmGeneratedFileStream(fname.c_str(), true));
ap->SetCopyIfDifferent(true); ap->SetCopyIfDifferent(true);
foutPtr.reset(ap.release()); foutPtr = ap;
} }
std::ostream& fout = *foutPtr.get(); std::ostream& fout = *foutPtr.get();