diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-06 16:33:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-07 13:24:04 (GMT) |
commit | 43d77e1dadab06f9b49ebb6cbfdaffcc4b708f1a (patch) | |
tree | cf92d28bba838e92c0ee9137683a44cf085ca8cb | |
parent | 98665c35199fffb66ff92f5f15da0e1580625cc0 (diff) | |
download | CMake-43d77e1dadab06f9b49ebb6cbfdaffcc4b708f1a.zip CMake-43d77e1dadab06f9b49ebb6cbfdaffcc4b708f1a.tar.gz CMake-43d77e1dadab06f9b49ebb6cbfdaffcc4b708f1a.tar.bz2 |
QtAutogen: Don't use std::i/ofstream::is_open()
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 506c820..eb513e5 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -390,13 +390,14 @@ bool cmQtAutoGenerators::WriteOldMocDefinitionsFile( { cmsys::ofstream outfile; outfile.open(filename.c_str(), std::ios::trunc); - success = outfile.is_open(); - if (success) { + if (outfile) { outfile << "set(AM_OLD_COMPILE_SETTINGS " << cmOutputConverter::EscapeForCMake( this->CurrentCompileSettingsStr) << ")\n"; success = outfile.good(); + } else { + success = false; } } @@ -1116,7 +1117,7 @@ bool cmQtAutoGenerators::GenerateMocFiles( if (success) { cmsys::ofstream outfile; outfile.open(this->OutMocCppFilenameAbs.c_str(), std::ios::trunc); - if (!outfile.is_open()) { + if (!outfile) { success = false; std::ostringstream err; err << "AUTOGEN: error opening " << this->OutMocCppFilenameAbs << "\n"; |