aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanos Farkas <chexum+git@gmail.com>2019-04-02 16:39:21 +0000
committerJanos Farkas <chexum+git@gmail.com>2019-04-02 16:39:21 +0000
commit587b022b0ad40758233c31a3ec9b140f075c3e61 (patch)
tree60e5bcd1e58b0c756136d67ca93a29b2cc44a848
parent2e246c196895a3bb211278d9405e8ea7e886eaa9 (diff)
downloadnextpnr-587b022b0ad40758233c31a3ec9b140f075c3e61.tar.gz
nextpnr-587b022b0ad40758233c31a3ec9b140f075c3e61.tar.bz2
nextpnr-587b022b0ad40758233c31a3ec9b140f075c3e61.zip
common: avoid std::ofstream copy
Using a copy constructor to set the logfile is the only thing that stops compilation with the libstdc++ shipping with gcc 4.8 (maybe 4.7)
-rw-r--r--common/command.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/command.cc b/common/command.cc
index 6f4137fe..49081e72 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -87,8 +87,8 @@ bool CommandHandler::executeBeforeContext()
if (vm.count("log")) {
std::string logfilename = vm["log"].as<std::string>();
- logfile = std::ofstream(logfilename);
- if (!logfile)
+ logfile.open(logfilename);
+ if (!logfile.is_open())
log_error("Failed to open log file '%s' for writing.\n", logfilename.c_str());
log_streams.push_back(std::make_pair(&logfile, LogLevel::LOG_MSG));
}